VishaalY/solutions-architect-hf-dataset huggingface dataset:
Question: What should I consider before purchasing an Amazon EC2 Reserved Instance?

I plan to use a particular Amazon Elastic Compute Cloud (Amazon EC2) instance configuration for steady-state workflows over a long period of time. What factors should I consider before purchasing a matching Reserved Instance?ResolutionConsider the following when deciding if Reserved Instances (RI) are right for you.Long term contractsReserved Instances have long contract terms (usually, one or three years). This means that you should purchase reservations only for an instance specification that you use over the long term.Billed as lump sumMost Reserved Instances are billed as a lump sum each month for each hour in that month. You're billed for this amount whether or not you ran an instance that matched your reservation. Reserved Instances provide the maximum discount for instance types that you use often and for long periods of time.If your account is in an organization's consolidated billing family, then additional considerations might apply. For more information, see How is the pricing benefit of a Reserved Instance applied across an organization's consolidated bill?Canceling and modifying a RIYou can't cancel a Reserved Instance. However, you can modify your Reserved Instance, subject to certain restrictions. For information about the available types of modifications, see Modify Reserved Instances.If you decide that you don't need an EC2 Reserved Instance after you purchase it and you have access to a US bank account, you can sell the Reserved Instance on the EC2 Reserved Instance Marketplace. For more details, see How do I sell an Amazon EC2 Reserved Instance on the Reserved Instance Marketplace?Capacity reservations and short-term discountsCapacity reservations apply only to zonal Reserved Instances, not Regional Reserved Instances. If you're interested in the capacity reservation but not the billing discount, then you might want to use On-Demand Capacity Reservations.For short-term discounts on EC2 instances, consider launching a Spot Instance instead.Pricing and purchasing an RIFor pricing information for EC2 Reserved Instances, see Amazon EC2 Reserved Instances Pricing.To purchase an EC2 Reserved Instance, see How do I purchase an Amazon EC2 Reserved Instance?After the reservation expires, the instance is charged as an On-Demand Instance. You can repurchase the RI to continue the discounted rate on your instance. You can schedule an EC2 Reserved Instance to renew automatically, see Can I schedule my EC2 Reserved Instance to renew automatically?Related informationInstance purchasing options
Question: How can I resolve the "View is stale; it must be re-created" error in Athena?

When I run a view query in Amazon Athena, I get a "stale view" error similar to the following: "SYNTAX_ERROR: line 1:15: View 'awsdatacatalog.mydatabase.myview' is stale; it must be re-created."ResolutionAthena reports a stale view under one of or more of the following conditions:The table or database that's specified in the view query doesn't exist.You tried to modify the table definition after you create the view.You tried to update the schema or metadata in a referenced table while recreating or updating the table.For example, your query fails with this error if you create a view and then run an ALTER TABLE ADD COLUMNS statement on the same table. The stale view error also happens if you run an AWS Glue crawler to update the table definition. For more information, see Considerations for views.To prevent "stale view" errors, recreate the view whenever you modify the underlying table or databases. You can also replace the view by adding the OR REPLACE clause in the CREATE VIEW statement. This clause lets you update the existing view by replacing it.

Related informationWorking with views
Question: How do I create a trust relationship between AWS Managed Microsoft AD and my existing on-premises AD domain?

I want to create a trust relationship between my on-premises domain and my AWS Directory Service for Microsoft Active Directory. Short descriptionA trust relationship is a link between two different domains, where one domain (the trusting domain) trusts another (the trusted domain). A one-way trust scenario allows the user accounts from the trusted domain to access resources in the trusting domain.AWS Managed Microsoft AD supports external and forest trust relationships with your existing on-premises domain in all three trust relationship directions:One-way incomingOne-way outgoingTwo-way (bidirectional)

ResolutionTo create a trust relationship between your AWS Managed Microsoft AD and your on-premises domain, perform the following steps:Important: You must create the trust on the on-premises domain first. Then, create the trust on your AWS Managed Microsoft AD.Complete all prerequisite steps.Prepare your on-premises domain for the trust relationship.Prepare your AWS Managed Microsoft AD for the trust relationship.Create the trust relationship between your on-premises Active Directory and your AWS Managed Microsoft AD.If you have connectivity issues, use the AWS Systems Manager AWSSupport-TroubleshootDirectoryTrust Automation document. For more information, see Run an automation.

Related informationTrust creation status reasonsWhat is AWS Directory Service?
Question: Why are some instance types disabled when I'm trying to launch an EC2 instance from an AMI?

I'm trying to launch an Amazon Elastic Compute Cloud (Amazon EC2) instance from an Amazon Machine Image (AMI). Why is the instance type I want to launch disabled?Short descriptionThe instance types A1, T4g, M6g, C6g, and R6g use AWS Graviton processors. AWS Graviton processors use the aarch64 (ARM64) architecture instead of x86_64 (AMD64).ARM64 architecture uses a different set of CPU instructions than the instructions used by the x86_64 architecture family. These instruction sets provide a mechanism for sending commands to the processor. During software compilation, the human-readable software code converts to CPU instructions specific to a CPU architecture. Any CPU of that architecture type can use these CPU instructions. However, the CPU of one architecture type can't understand the instruction set of another type. So, an AMI compiled from one architecture runs only on the CPUs of that architecture type.ARM64 and x86_64 architectures use different instruction sets. This means that EC2 instances and AMIs created using the x86_64 architecture aren't compatible with instances use the ARM64 architecture. This incompatibility causes one of the following to happen when launching or changing instances types:When launching a Graviton instance type with your selected EC2 AMI, the launch wizard might display the new instance types as disabled.If you change the instance type of an already deployed EC2 instance that isn't currently using the new architecture type, you might receive an error. The error message is similar to the following:"'m6g.large' is not a valid instance type for instance 'i-xyz' of architecture 'x86_64'".To use a different architecture, first create a new EC2 instance or AMI.Note: An AMI might be incompatible with your instance type without enhanced networking enabled. For more information, see How do I enable and configure enhanced networking on my EC2 instances?ResolutionLaunching new instancesAll major Linux distributions are available on ARM architecture. To launch an instance using ARM architecture:Open the Amazon EC2 console.Choose Launch instance, Launch instance.Choose 64-bit (ARM) next to the AMI corresponding to the ARM version of your favorite distribution, and then choose Select.Complete launching the instance.After you start the instance, it behaves like any EC2 instance.Changing instance typesBecause of the different instruction sets, a direct instance type change isn't possible between architecture types. To migrate your system to the new architecture, do the following:Launch a new EC2 instance of your desired configuration.Migrate your application to the new EC2 instance.

Related informationAWS Graviton processor
Question: How can I turn on automatic encryption of new Amazon EBS volumes and snapshot copies created in my account?

I'm manually encrypting new Amazon Elastic Block Storage (Amazon EBS) volumes that I create. But, I want to automatically encrypt new Amazon EBS volumes and snapshot copies.

Short descriptionNewly created Amazon EBS volumes aren't encrypted by default. However, you can turn on default encryption for new EBS volumes and snapshot copies that are created within a specified Region. To turn on encryption by default, use the Amazon Elastic Compute Cloud (Amazon EC2) console.Before you turn on encryption by default, consider the following points:Encryption by default is a Region-specific setting. After you turn on encryption for a Region, you can't turn it off for individual volumes or snapshots in that Region.After you turn on encryption by default, you can launch an instance only if the instance type supports Amazon EBS encryption.Turning on encryption by default doesn't change any existing unencrypted or encrypted resources. It encrypts only volumes and snapshot copies that you create after turning on default encryption.If default encryption is turned on, and you’re experiencing delta replication failures when migrating services using AWS Server Migration Service, then turn off default encryption. For lift-and-shift migration, it's a best practice to use AWS Application Migration Service (AWS MGN).

ResolutionOpen the Amazon EC2 console.In the navigation bar, select the Region.In the navigation pane, choose EC2 Dashboard.In the upper-right corner, choose Account Attributes, EBS encryption.Choose Manage.For Always encrypt new EBS volumes, choose Enable.Choose Default encryption key, and then select any of your keys to set as the default.Choose Update EBS encryption.Repeat these steps for other Regions as needed.Note: If you select the default service key (aws/ebs) as the default encryption key, then you can't share the encrypted volume across accounts. To learn more about AWS KMS keys, see AWS KMS concepts.
Question: What do I need to do to update my SSL/TLS certificate for an Amazon RDS DB instance or Aurora DB cluster?

I received an email that says the SSL/TLS certificate that is used by my Amazon Relational Database Service (Amazon RDS) DB instance or Amazon Aurora DB cluster is expiring on March 5, 2020. What do I need to do?Short DescriptionAmazon RDS and Aurora SSL/TLS certificates that were created before January 14, 2020 are expiring on March 5, 2020. If your certificate expires, you can lose connectivity to your RDS DB instance or Aurora DB cluster.

ResolutionTo find out whether your applications connect to Amazon RDS databases using SSL/TLS and for other troubleshooting steps, see the following AWS Database Blog post: Update your SSL/TLS certificates by March 5, 2020.To rotate your SSL/TLS certificate, first update your client application or service to include the new CA certificates in its trust store using the combined bundle that contains both the new and the old CA certificates. Then, update your RDS DB instances to use the new CA certificates. It's important to test the client and server before deploying the new SSL/TLS certificate to your production environment. For complete instructions for updating your SSL/TLS certificates, see the following:Rotating Your SSL/TLS Certificate for Amazon RDSRotating Your SSL/TLS Certificate for Amazon AuroraRelated InformationUsing SSL/TLS to Encrypt a Connection to a DB Instance
Question: Why can't Amazon SES publish data to an Amazon SNS topic?

I got a notification from AWS telling me that Amazon Simple Email Service (Amazon SES) failed to publish data to my Amazon Simple Notification Service (Amazon SNS) topic.

ResolutionCheck the following:Use the Amazon SNS console to check that the topic still exists. Be sure to review the AWS Region selector in the navigation bar—you must select the Region that you expect the SNS topic to be in. If the topic was deleted, create a new topic.Confirm that the SNS topic is in the same Region as the Amazon SES endpoint that you use to receive emails. For more information on this requirement, see SNS action.Check the SNS topic's access policy and confirm that the policy grants access from Amazon SES. For more information on SNS topic access policies, see Using the access policy language and Example cases for Amazon SNS access control.Check if the SNS topic is using server-side encryption (SSE). If the topic is using SSE, you must check the policy of the AWS Key Management Service (AWS KMS) encryption key that the SNS topic is using. Then, confirm that the key policy grants Amazon SES permissions to the encryption key.

Related informationIdentity and access management in Amazon SNS
Question: How do I monitor the logs of multiple Amazon EC2 instances in AWS OpsWorks Stacks?

I want to track the logs of my Amazon Elastic Compute Cloud (Amazon EC2) instances in AWS OpsWorks Stacks. How do I do that?ResolutionTo monitor the logs of Amazon EC2 instances that are managed by OpsWorks Stacks, do the following:Activate Amazon CloudWatch Logs for your instances at the layer level in OpsWorks Stacks.Monitor the logs for your instances in the CloudWatch console.For more information, see Using Amazon CloudWatch Logs with AWS OpsWorks Stacks.

Related informationGetting started with CloudWatch Logs
Question: How do I launch ECS instances with Amazon ECS-optimized AMIs?

I want to launch instances with Amazon Machine Images (AMIs) optimized for Amazon Elastic Container Service (Amazon ECS). How can I do that?Short descriptionTo launch Amazon ECS-optimized AMIs, you can choose from the following options:Launch an Amazon ECS-optimized container instance with an Amazon ECS-optimized AMI from the Amazon Elastic Compute Cloud (Amazon EC2) consoleAutomate the creation of your Amazon ECS-optimized AMIs

ResolutionLaunch an Amazon ECS-optimized container instance with an Amazon ECS-optimized AMIOpen the Amazon EC2 console.In the Create Instance section, choose Launch Instance.From the left navigation pane, choose AWS Marketplace. Then, enter ecs-optimized in the search bar.Choose one of the following AMI versions based on your needs: Amazon Linux AMI, Amazon Linux 2 AMI, Windows Server 2016, or Amazon Linux 2 AMI (ARM).Important: To get your Amazon ECS-optimized instance to join your Amazon ECS cluster, see Launching an Amazon ECS Linux container instance.Automate the creation of your Amazon ECS-optimized AMIsUse AWS Systems Manager parameters to automate and retrieve Amazon ECS-optimized AMI metadata.In the following example, the image_id sub-parameter returns the machine image AMI ID for only the current recommended Amazon Linux EC2-optimized AMI version in us-east-1.aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux/recommended/image_id --region us-east-1 --query "Parameters[0].Value"You can use the AMI ID to launch your Amazon Linux container instance in us-east-1. You can also modify the command to return the machine image for a specific version and AWS Region.Important: To use SSM parameters, run the most up-to-date version of the AWS Command Line Interface (AWS CLI).You can use SSM parameters as input parameters for AWS CloudFormation templates. See the following example:AWSTemplateFormatVersion: '2010-09-09'Parameters:  ImageId:    Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>    Description: Use an Image from SSM Parameter Store    Default: /aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_idResources:  EC2Instance:    Type: AWS::EC2::Instance    Properties:      InstanceType: t3.micro      SecurityGroups: [!Ref 'EC2SecurityGroup']      ImageId: !Ref ImageId  EC2SecurityGroup:    Type: AWS::EC2::SecurityGroup    Properties:      GroupDescription: SSH access      SecurityGroupIngress:      - IpProtocol: tcp        FromPort: '22'        ToPort: '22'        CidrIp: 0.0.0.0/0Related informationAmazon Machine Images (AMI)
Question: How can I resolve SageMaker Python SDK rate exceeded and throttling exceptions?

How can I resolve throttling errors such as "botocore.exceptions.ClientError: An error occurred (ThrottlingException)" when using the Amazon SageMaker Python SDK?Short descriptionAPI calls to any AWS service can't exceed the maximum allowed API request rate per account and per AWS Region. These API calls might be from an application, the AWS Command Line Interface (AWS CLI), or the AWS Management Console. If the API requests exceed the maximum rate, then you receive the “Rate Exceeded” error, and the API calls are throttled.You might get this error when calling the SageMaker APIs because of the default retry configuration in Boto3. You can override this configuration to increase the number of retry attempts and the timeouts for connecting and reading a response.You can resolve this error by adding a SageMaker boto3 client with a custom retry configuration to the SageMaker Python SDK client.Resolution1.    Create a SageMaker boto3 client with a custom retry configuration. Example:import boto3 from botocore.config import Configsm_boto = boto3.client('sagemaker', config=Config(connect_timeout=5, read_timeout=60, retries={'max_attempts': 20}))print(sm_boto.meta.config.retries)2.    Create a SageMaker Python SDK client using the boto3 client from the previous step. Example:import sagemakersagemaker_session = sagemaker.Session(sagemaker_client = sm_boto)region = sagemaker_session.boto_session.region_nameprint(sagemaker_session.sagemaker_client.meta.config.retries)3.    Test a SageMaker API with multiple requests from the SageMaker Python SDK. Example:import multiprocessingdef worker(TrainingJobName):    print(sagemaker_session.sagemaker_client          .describe_training_job(TrainingJobName=TrainingJobName)          ['TrainingJobName'])    returnif __name__ == '__main__':    jobs = []    TrainingJobName = 'your-job-name'    for i in range(10):        p = multiprocessing.Process(target=worker, args=(TrainingJobName,))        jobs.append(p)        p.start()4.    Create an instance of the sagemaker.estimator.Estimator class with the sagemaker_session parameter. Example:estimator = sagemaker.estimator.Estimator(container,                                             role,                                              train_instance_count=1,                                              train_instance_type='ml.c4.4xlarge',                                             train_volume_size = 30,                                             train_max_run = 360000,                                             input_mode= 'File',                                             output_path=s3_output_location,                                             sagemaker_session=sagemaker_session )5.    To confirm that the retry configuration resolves the throttling exceptions, launch a training job from the estimator that you created in the previous step:estimator.fit()

Related informationBoto3 documentation
Question: Why am I getting an Access Denied error when I open the URL to an Amazon S3 object that I have access to?

I have permission to access an object in Amazon Simple Storage Service (Amazon S3) bucket. I opened the URL in the Amazon S3 console for that object. However, I got an Access Denied error message. How can I fix this?Short descriptionThe URL to the Amazon S3 object doesn't include your user credentials, so the request to the object is anonymous. Amazon S3 returns an Access Denied error for anonymous requests to objects that aren't public.

ResolutionNote: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent version of the AWS CLI.Do one of the following:Download the object using the Amazon S3 console, AWS CLI, AWS SDKs, or REST API. For instructions, see Downloading an object.-or-Include the user credentials in the object request using a presigned URL. For instructions, see Sharing objects using presigned URLs.Important: It's a security best practice to keep objects private and to set up users with a presigned URL for authenticated requests to access objects. However, if your use case supports public read access to your objects that requires you to access using the URL, then modify the objects permission. To set up public read access to the object, see Granting read-only permission to an anonymous user.

Related informationConfiguring ACLsIdentity and access management in Amazon S3
Question: How can I automate Amazon EBS snapshot management using Amazon Data Lifecycle Manager?

I want to automate the creation, retention, and deletion of Amazon Elastic Block Storage (Amazon EBS) snapshots used for backing up my Amazon EBS volumes. How do I do that?Short DescriptionAmazon Data Lifecycle Manager (Amazon DLM) is an automated procedure to back up the data stored on your Amazon EBS volumes. Use Amazon DLM to create lifecycle policies to automate snapshot management.

ResolutionCreate a lifecycle policy in Amazon DLM:1.    In the Amazon Elastic Compute Cloud (Amazon EC2) console, under Elastic Block Store, select Lifecycle Manager.2.    Select Create Snapshot Lifecycle Policy.3.    Enter a Description for the policy.4.    Select a resource type. Select Volume if you want to schedule snapshots for volumes with a specific tag. Select Instance if you want to schedule snapshots for all volumes attached to an instance with a specific tag.5.    Select the tags associated with the Amazon EBS volume or Amazon EC2 instance, depending on the option chosen above.6.    Add a Schedule name to your policy. Any snapshot created with this policy is automatically tagged with the schedule name entered here.7.    Enter the number of hours that will elapse between policy runs.8.    Enter the policy run start time. Snapshot creation starts within one hour of the specified start time.9.    Set the Retention rule to the maximum number of snapshots that you want to retain. The oldest snapshot beyond this number will be deleted.10.    Optionally, select Copy Tags from volume to copy all user-defined tags on a source volume to snapshots of the volume created by this policy.11.    Optionally, add additional tags to the created snapshots by selecting Add Tag. These tags are in addition to any tags that were copied from the volumes or added as default by Amazon DLM.12.    Select an AWS Identity and Access Management (IAM) role that has snapshot create and delete permissions. The Default role has the required permissions. If you don't want to use the default role, you can create a new role with the required permissions using the IAM console. Select the new role when creating your lifecycle policy. The following permissions are required for a role to use Amazon DLM."ec2:CreateSnapshot",     "ec2:CreateSnapshots", "ec2:DeleteSnapshot","ec2:DescribeVolumes", "ec2:DescribeInstances",   "ec2:DescribeSnapshots"13.    Review the Policy Summary to verify that the specified rules meet your requirements.14.    Select Enable policy to start the policy runs at the next scheduled time. If Enable policy is not selected, the policy will not create or delete snapshots.15.    Select Create Policy.Related InformationAmazon Data Lifecycle Manager - Permissions for IAM Users