Skip to main content

AWS Backup and Enhances SNS Notifications to filter on job status

AWS Backup and Enhances SNS Notifications to filter on job status


1. AWS Backup

2. AWS Backup Enhances SNS Notifications to filter on job status



                                         AWS Backup


AWS Backup is a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services in the cloud as well as on premises using the AWS Storage Gateway. Using AWS Backup, you can centrally configure backup policies and monitor backup activity for AWS resources, such as Amazon EBS volumes, Amazon RDS databases, Amazon DynamoDB tables, Amazon EFS file systems, and AWS Storage Gateway volumes. AWS Backup automates and consolidates backup tasks previously performed service-by-service, removing the need to create custom scripts and manual processes. With just a few clicks in the AWS Backup console, you can create backup policies that automate backup schedules and retention management. AWS Backup provides a fully managed, policy-based backup solution, simplifying your backup management, enabling you to meet your business and regulatory backup compliance requirements.


Getting Started with AWS Backup

This tutorial shows you how to perform the tasks necessary to back up and restore your resources using AWS Backup.
Topics

Prerequisites

Before you begin, ensure that you have the following:
  • An AWS account. For more information, see Setting Up.
  • An Amazon Elastic Block Store (Amazon EBS) volume. For information about Amazon EBS, see Amazon Elastic Block Store (Amazon EBS) in the Amazon EC2 User Guide for Linux Instances.
    For information about creating an Amazon EBS volume, see Creating an Amazon EBS Volume in the Amazon EC2 User Guide for Linux Instances.
  • You should be familiar with the services that you are backing up. You also need a set of resources that you will protect with AWS Backup.
    AWS Backup currently supports the following services:
    • For information about getting started with Amazon EFS and creating Amazon EFS resources, see Getting Started with Amazon Elastic File System in the Amazon Elastic File System User Guide.
    • For information about setting up and creating DynamoDB resources, see Getting Started with DynamoDB in the Amazon DynamoDB Developer Guide.
    • Amazon Relational Database Service (Amazon RDS)
      For information about getting started with Amazon RDS, see Getting Started with Amazon RDS in the Amazon RDS User Guide.
      Note
      AWS Backup currently supports all Amazon RDS database engines except Amazon Aurora.
    • For information about creating a volume gateway, see Creating a Volume Gateway in the AWS Storage Gateway User Guide.
  • Your resources are all in the same AWS Region. This tutorial uses the US East (N. Virginia) Region (us-east-1).
  • You have AWS resources that you will be backing up in the Region that you're using for this tutorial.
To complete this tutorial, you can use your AWS account root user to sign in to the AWS Management Console. However, AWS Identity and Access Management (IAM) recommends that you not use the AWS account root user. Instead, create an administrator in your account and use those credentials to manage resources in your account. For more information, see Setting Up
.

Setting Up

Before you use AWS Backup for the first time, complete the following tasks:

Sign up for AWS

When you sign up for Amazon Web Services (AWS), your AWS account is automatically signed up for all services in AWS, including AWS Backup. You are charged only for the services that you use.
For more information about AWS Backup usage rates, see the AWS Backup Pricing page. If you are a new AWS customer, you can get started with AWS Backup for free. For more information, see AWS Free Usage Tier.
If you have an AWS account already, skip to the next task. If you don't have an AWS account, use the following procedure to create one.
To create an AWS account
  1. Open https://portal.aws.amazon.com/billing/signup.
  2. Follow the online instructions.
    Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.
Note your AWS account number, because you'll need it for the next task.

Create an IAM User

Services in AWS, such as AWS Backup, require that you provide credentials when you access them, so that the service can determine whether you have permissions to access its resources. AWS recommends that you do not use the AWS account root user to make requests. Instead, create an IAM user, and grant that user full access. We refer to these users as administrator users. You can use the administrator user credentials, instead of the AWS account root user credentials, to interact with AWS and perform tasks, such as create a bucket, create users, and grant them permissions. For more information, see AWS Account Root User Credentials vs. IAM User Credentials in the AWS General Reference and IAM Best Practices in the IAM User Guide.
If you signed up for AWS but have not created an IAM user for yourself, you can create one using the IAM console.
To create an administrator user for yourself and add the user to an administrators group (console)
  1. Use your AWS account email address and password to sign in as the AWS account root user to the IAM console at https://console.aws.amazon.com/iam/.
    Note
    We strongly recommend that you adhere to the best practice of using the Administrator IAM user below and securely lock away the root user credentials. Sign in as the root user only to perform a few account and service management tasks.
  2. In the navigation pane, choose Users and then choose Add user.
  3. For User name, enter Administrator.
  4. Select the check box next to AWS Management Console access. Then select Custom password, and then enter your new password in the text box.
  5. (Optional) By default, AWS requires the new user to create a new password when first signing in. You can clear the check box next to User must create a new password at next sign-in to allow the new user to reset their password after they sign in.
  6. Choose Next: Permissions.
  7. Under Set permissions, choose Add user to group.
  8. Choose Create group.
  9. In the Create group dialog box, for Group name enter Administrators.
  10. Choose Filter policies, and then select AWS managed -job function to filter the table contents.
  11. In the policy list, select the check box for AdministratorAccess. Then choose Create group.
    Note
    You must activate IAM user and role access to Billing before you can use the AdministratorAccess permissions to access the AWS Billing and Cost Management console. To do this, follow the instructions in step 1 of the tutorial about delegating access to the billing console.
  12. Back in the list of groups, select the check box for your new group. Choose Refresh if necessary to see the group in the list.
  13. Choose Next: Tags.
  14. (Optional) Add metadata to the user by attaching tags as key-value pairs. For more information about using tags in IAM, see Tagging IAM Entities in the IAM User Guide.
  15. Choose Next: Review to see the list of group memberships to be added to the new user. When you are ready to proceed, choose Create user.
You can use this same process to create more groups and users and to give your users access to your AWS account resources. To learn about using policies that restrict user permissions to specific AWS resources, see Access Management and Example Policies.
To sign in as this new IAM user, sign out of the AWS Management Console. Then use the following URL, where your_aws_account_id is your AWS account number without the hyphens (for example, if your AWS account number is 1234-5678-9012, your AWS account ID is 123456789012):

https://your_aws_account_id.signin.aws.amazon.com/console/

Enter the IAM user name and password that you just created. When you're signed in, the navigation bar displays your_user_name@your_aws_account_id.
If you don't want the URL for your sign-in page to contain your AWS account ID, you can create an account alias. From the IAM dashboard, click Create Account Alias and enter an alias, such as your company name. To sign in after you create an account alias, use the following URL:

https://your_account_alias.signin.aws.amazon.com/console/

To verify the sign-in link for IAM users for your account, open the IAM console and check under AWS Account Alias on the dashboard.


AWS Backup Enhances SNS Notifications to filter on job status



AWS Backup now provides customers an automated way to receive notifications based on the status of their backup, restore, and recovery point jobs. For customers using SNS notifications to monitor their backups, this functionality will allow customers to directly filter for certain job status types, such as failed backup jobs. Prior to this, customers would have to discern the job status from the message, without the ability to filter on this attribute. This release is a continuation of our commitment to make data protection as seamless and as automated as possible for our customers. See the SNS for AWS Backup for instructions and best practices.
AWS Backup offers a centralized, managed service to back up data across AWS services in the cloud and on premises using Storage Gateway. AWS Backup serves as a single dashboard for backup, restore, and policy-based retention of different AWS resources, including Amazon EBS volumes, Amazon RDS databases, Amazon DynamoDB tables, Amazon EFS file systems, and AWS Storage Gateway volumes.  

Using Amazon SNS to Track AWS Backup Events

AWS Backup is designed to take advantage of the robust notifications delivered by Amazon Simple Notification Service (Amazon SNS). You configure Amazon SNS to send notifications for AWS Backup events from the Amazon SNS console. For more information, see Getting Started with Amazon SNS in the Amazon Simple Notification Service Developer Guide.

AWS Backup Notification APIs

After creating your topics using the Amazon SNS console or AWS Command Line Interface (AWS CLI), you can use the following AWS Backup API operations to manage your backup notifications.
  • DeleteBackupVaultNotifications — Deletes event notifications for the specified backup vault.
  • GetBackupVaultNotifications — Lists all event notifications for the specified backup vault.
  • PutBackupVaultNotifications — Turns on notifications for the specified topic and events.
The following events are supported:
Backup jobs
  • BACKUP_JOB_STARTED
  • BACKUP_JOB_COMPLETED
Restore jobs
  • RESTORE_JOB_STARTED
  • RESTORE_JOB_COMPLETED
Recovery points
  • RECOVERY_POINT_MODIFIED

Completed Events

Completed notifications include a STATE attribute indicating the specific type of completion.

Example Completed Events



{
    "Type" : "Notification",
    "MessageId" : "12345678-abcd-123a-def0-abcd1a234567",
    "TopicArn" : "arn:aws:sns:us-west-1:123456789012:backup-2sqs-sns-topic",
    "Subject" : "Notification from AWS Backup",
    "Message" : "An AWS Backup job was completed successfully. Recovery point ARN: arn:aws:ec2:us-west-1:123456789012:volume/vol-012f345df6789012d. Resource ARN : arn:aws:ec2:us-west-1:123456789012:volume/vol-012f345df6789012e. BackupJob ID : 1b2345b2-f22c-4dab-5eb6-bbc7890ed123",
    "Timestamp" : "2019-08-02T18:46:02.788Z",
    "MessageAttributes" : {
        "EventType" : {"Type":"String","Value":"BACKUP_JOB"},
        "State" : {"Type":"String","Value":"SUCCESSFUL"},
        "AccountId" : {"Type":"String","Value":"123456789012"},
        "Id" : {"Type":"String","Value":"1b2345b2-f22c-4dab-5eb6-bbc7890ed123"},
        "StartTime" : {"Type":"String","Value":"2019-09-02T13:48:52.226Z"}
    }
}
            



{
    "Type" : "Notification",
    "MessageId" : "12345678-abcd-123a-def0-abcd1a234567",
    "TopicArn" : "arn:aws:sns:us-west-1:123456789012:backup-2sqs-sns-topic",
    "Subject" : "Notification from AWS Backup",
    "Message" : "An AWS Backup job failed. Resource ARN : arn:aws:ec2:us-west-1:123456789012:volume/vol-012f345df6789012e. BackupJob ID : 1b2345b2-f22c-4dab-5eb6-bbc7890ed123",
    "Timestamp" : "2019-08-02T18:46:02.788Z",
    "MessageAttributes" : {
        "EventType" : {"Type":"String","Value":"BACKUP_JOB"},
        "State" : {"Type":"String","Value":"FAILED"},
        "AccountId" : {"Type":"String","Value":"123456789012"},
        "Id" : {"Type":"String","Value":"1b2345b2-f22c-4dab-5eb6-bbc7890ed123"},
        "StartTime" : {"Type":"String","Value":"2019-09-02T13:48:52.226Z"}
    }
}   




{
    "Type" : "Notification",
    "MessageId" : "12345678-abcd-123a-def0-abcd1a234567",
    "TopicArn" : "arn:aws:sns:us-west-1:123456789012:backup-2sqs-sns-topic",
    "Subject" : "Notification from AWS Backup",
    "Message" : "An AWS Backup job failed to complete in time. Resource ARN : arn:aws:ec2:us-west-1:123456789012:volume/vol-012f345df6789012e. BackupJob ID : 1b2345b2-f22c-4dab-5eb6-bbc7890ed123",
    "Timestamp" : "2019-08-02T18:46:02.788Z",
    "MessageAttributes" : {
        "EventType" : {"Type":"String","Value":"BACKUP_JOB"},
        "State" : {"Type":"String","Value":"EXPIRED"},
        "AccountId" : {"Type":"String","Value":"123456789012"},
        "Id" : {"Type":"String","Value":"1b2345b2-f22c-4dab-5eb6-bbc7890ed123"},
        "StartTime" : {"Type":"String","Value":"2019-09-02T13:48:52.226Z"}
    }
    


AWS Backup Notification Command Examples

You can use AWS CLI commands to subscribe to, list, and delete Amazon SNS notifications for your AWS Backup events.

Example Put Backup Vault Notification

The following command subscribes to an Amazon SNS topic for the specified backup vault that notifies you when a restore job is started or completed, or when a recovery point is modified.


aws backup --endpoint-url https://backup.region.amazonaws.com put-backup-vault-notifications 
    --backup-vault-name  --sns-topic-arn arn:aws:sns:region:account-id:myBackupTopic
    --backup-vault-events RESTORE_JOB_STARTED RESTORE_JOB_COMPLETED RECOVERY_POINT_MODIFIED
            

aws backup --endpoint-url https://backup.region.amazonaws.com get-backup-vault-notifications 
           --backup-vault-name myVault
            

{
    "SNSTopicArn": "arn:aws:sns:region:account-id:myBackupTopic",
    "BackupVaultEvents": [
        "RESTORE_JOB_STARTED",
        "RESTORE_JOB_COMPLETED",
        "RECOVERY_POINT_MODIFIED"
    ],
    "BackupVaultName": "myVault",
    "BackupVaultArn": "arn:aws:backup:region:account-id:backup-vault:myVault"
}
            

aws backup --endpoint-url https://backup.region.amazonaws.com delete-backup-vault-notifications 
           --backup-vault-name myVault
            

Specifying AWS Backup as a Service Principal

Note
To allow AWS Backup to publish SNS topics on your behalf, you must specify AWS Backup as a service principal.
Include the following JSON in the access policy of the Amazon SNS topic that you use to track AWS Backup events. You must specify the resource Amazon Resource Name (ARN) of your topic.


{
      "Sid": "My-statement-id",
      "Effect": "Allow",
      "Principal": {
        "Service": "backup.amazonaws.com"
      },
      "Action": "SNS:Publish",
      "Resource": "arn:aws:sns:region:account-id:myTopic"
}
    

The following sample JSON is an example of a basic Amazon SNS access policy that includes AWS Backup as a service principal. You must specify your own AWS account ID and the resource ARN of your topic.



{
  "Version": "2008-10-17",
  "Id": "__default_policy_ID",
  "Statement": [
    {
      "Sid": "__default_statement_ID",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": [
        "SNS:Publish",
        "SNS:RemovePermission",
        "SNS:SetTopicAttributes",
        "SNS:DeleteTopic",
        "SNS:ListSubscriptionsByTopic",
        "SNS:GetTopicAttributes",
        "SNS:Receive",
        "SNS:AddPermission",
        "SNS:Subscribe"
      ],
      "Resource": "arn:aws:sns:region:account-id:myTopic",
      "Condition": {
        "STRINGEQUALS": {
          "AWS:SourceOwner": "account-id"
        }
      }
    },
    {
      "Sid": "__console_pub_0",
      "Effect": "Allow",
      "Principal": {
        "Service": "backup.amazonaws.com"
      },
      "Action": "SNS:Publish",
      "Resource": "arn:aws:sns:region:account-id:myTopic"
    }
  ]
}        
    



Comments

  1. Hey,
    Thank you for this informative post. well written and well explained.
    AWS Classes in Pune

    ReplyDelete
  2. This is a very nice one and gives in-depth information. I am really happy with the quality and presentation of the article. I’d really like to appreciate the efforts you get with writing this post. Thanks for sharing.
    aws course in pune

    ReplyDelete
  3. I cannot thank you enough for the blog.Thanks Again. Keep writing.
    servicenow training
    servicenow online training

    ReplyDelete
  4. Thank you for introducing this tool. keep it updated.
    AWS Training
    AWS Course

    ReplyDelete

Post a Comment

Popular posts from this blog

AWS S3 Simple Storage Service

                             Amazon  S3  (Simple Storage Service) Amazon Simple Storage Service is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon  S3  has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web. What Is Amazon S3? Amazon Simple Storage Service is storage for the Internet. It is designed to make web-scale computing easier for developers. Amazon S3 has a simple web services interface that you can use to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, fast, inexpensive data storage infrastructure that Amazon uses to run its own global network of web sites. The service aims to maximize benefits of scale and to pass those benefits on to developers. This guide explains the core concepts of Amazon S3, such as buckets and

Amazon SageMaker

            Amazon SageMaker    Machine learning for every developer and data scientist. Amazon SageMaker provides every developer and data scientist with the ability to build, train, and deploy machine learning models quickly. Amazon SageMaker is a fully-managed service that covers the entire machine learning workflow to label and prepare your data, choose an algorithm, train the model, tune and optimize it for deployment, make predictions, and take action. Your models get to production faster with much less effort and lower cost BUILD Collect & prepare training data Data labeling & pre-built notebooks for common problems Choose & optimize your ML algorithm Built-in, high-performance algorithms and hundreds of ready to use algorithms in AWS Marketplace TRAIN Set up & manage environments for training One-click training using Amazon EC2 On-Demand or Spot instances Train & tune model Train once, run anywhere & model optimiz

Amazon EBS Elastic Block Store

     Amazon Elastic Block Store Amazon  Elastic Block Store  (Amazon  EBS ) provides persistent block storage volumes for use with Amazon EC2 instances in the  AWS  Cloud. Each Amazon  EBS volume is automatically replicated within its Availability Zone to protect you from component failure, offering high availability and durability. Amazon Elastic Block Store (Amazon EBS) provides persistent block storage volumes for use with  Amazon EC2  instances in the AWS Cloud. Each Amazon EBS volume is automatically replicated within its Availability Zone to protect you from component failure, offering high availability and durability. Amazon EBS volumes offer the consistent and low-latency performance needed to run your workloads. With Amazon EBS, you can scale your usage up or down within minutes – all while paying a low price for only what you provision. Amazon EBS is designed for application workloads that benefit from fine tuning for performance, cost and capacity. Typical use c