VishaalY/solutions-architect-hf-dataset huggingface dataset:
Question: "How can I store an Amazon Athena query output in a format other than CSV, such as a compressed format?"

I want to store Amazon Athena query results in a format other than CSV, such as JSON or a compressed format.

ResolutionAthena supports CSV output files only. The UNLOAD query writes query results from a SELECT statement to the specified data format. Supported formats for UNLOAD include Apache Parquet, ORC, Apache Avro, and JSON. CSV is the only output format used by the Athena SELECT query, but you can use UNLOAD to write the output of a SELECT query to the formats that UNLOAD supports. Although you can use the CTAS statement to output data in formats other than CSV, those statements also require the creation of a table in Athena. The UNLOAD statement is useful when you want to output the results of a SELECT query in a non-CSV format but don't require the associated table. For example, a downstream application might require the results of a SELECT query to be in JSON format, and Parquet or ORC might provide a performance advantage over CSV if you intend to use the results of the SELECT query for additional analysis.To store query output files in a different format, use a CREATE TABLE AS SELECT (CTAS) query, and then configure the format property. After the query completes, drop the CTAS table. Keep the following in mind:You can set format to ORC, PARQUET, AVRO, JSON, or TEXTFILE. If you don't specify a format for the CTAS query, then Athena uses Parquet by default.The name of the parameter, format , must be listed in lowercase, or your CTAS query fails. For an example, see Example: Writing query results to a different format.By default, all CTAS queries use GZIP compression. For Parquet and ORC, you can use the parquet_compression and orc_compression options to specify other compression types, such as SNAPPY. For an example, see Example: Specifying data storage and compression formats.For text-based formats, you can specify a field_delimiter like this: WITH (field_delimiter = ',') . If you don't specify a field delimiter, then Athena uses \001 by default.If you use the external_location parameter in the CTAS query, then be sure that the Amazon Simple Storage Service (Amazon S3) location has no data. Otherwise, you might see an error like this: "HIVE_PATH_ALREADY_EXISTS: Target directory for table 'table_name' already exists: s3://AWSDOC-EXAMPLE-BUCKET". For more information about the external_location parameter, see CTAS table properties.

Related informationConsiderations and limitations for CTAS queries
Question: How can I install CloudFormation helper scripts on Ubuntu 16.04 LTS/Ubuntu 18.04 LTS/Ubuntu 20.04 LTS/Ubuntu 22.04 LTS or RHEL 9 AMIs?

I want to install AWS CloudFormation helper scripts on Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, and RHEL 9 Amazon Machine Images (AMIs).

Short descriptionYou must install helper scripts for Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, and RHEL 9 AMIs during the boot process. Use the UserData property to download and install the AMIs. Then, start the cfn-hup service at launch. To get the latest binaries of the aws-cfn-bootstrap package, see CloudFormation helper scripts reference.Resolution1.    Review the templates for Ubuntu 16.04 LTS script, Ubuntu 18.04 LTS script, Ubuntu 20.04 LTS script, Ubuntu 22.04 LTS script, on RHEL 9 script on GitHub. These scripts create a service in systemd to allow the cfn-hup helper daemon to automatically start at boot.Important: Make systemd a dependency of an existing boot target. Use multi-user.target to create the dependency.2.    Review how to define the UserData property of the instance.3.    Create the cfn-hup configuration file, cfn-hup hook, and systemd file for cfn-hup /lib/systemd/systemcfn-hup.service. Refer to the instructions that are set in the files key.4.    To activate the service in systemd and start the service, use the commands key.5.    To confirm that the cfn-hup service starts after it launches the stack, run the following command:systemctl status cfn-hupIf cfn-hup starts successfully, then you receive an output that's similar to the following one:cfn-hup.service - cfn-hup daemon   Loaded: loaded (/usr/lib/systemd/system/cfn-hup.service; enabled; vendor preset: disabled)   Active: active (running) since Wed 2016-10-12 08:10:26 EDT; 1min 11s ago MainPID: 4852 (cfn-hup)   CGroup: /system.slice/cfn-hup.service                       └─4852 /usr/bin/python /opt/aws/bin/cfn-hupOct 12 08:10:26 ip-172-31-44-180.ec2.internal systemd[1]: Started cfn-hup daemon. Oct 12 08:10:26 ip-172-31-44-180.ec2.internal systemd[1]: Starting cfn-hup daemon...Note: If you use systemd, then the cfn-init helper script doesn't support the services key. Instead, use the commands key as shown in the previous example.

Related informationCFNhelpernonAMZNAMIs (GitHub)
Question: How can I add multiple Firewall Manager admininstrator accounts?

I want to add multiple AWS Firewall administrators to manage firewall resources in my AWS Organizations organization.

Short descriptionYou can have up to 10 Firewall Manager administrators to manage the firewall resources of your organization. For example, you can have one administrator manage a set of organizational units (OUs) for your organization. You can also delegate another administrator to manage only specific Firewall Manager policy types.

ResolutionFollow these steps to create another Firewall Manager administrator account to manage the security policies for your organization.Note: If you didn't set up Firewall Manager for an AWS account, then first set one up.1.    Open the Firewall Manager console with your management account.2.    In the navigation pane, expand AWS Firewall Manager, and then choose Settings. Note the Default administrator account. This is the default Firewall Manager account is the first administrator account that was created.3.    In Settings, choose Create administrator account.4.    In Administrator account ID, enter the AWS account to set as another Firewall Manager administrator.5.    Choose the Administrative Scope dropdown menu, and then choose either Full or Restricted.Note: Full scope gives the administrator full access to all of the preceding resource types. Restricted scope gives administrative permission to only a subset of the preceding resources. It's a best practice to grant administrators only the necessary permissions to perform the duties of their role.6.    Choose Create administrator account.For more information, see Working with AWS Firewall Manager administrators.Related InformationManaging the AWS accounts in your organizationAWS Firewall Manager prerequisitesFirewall Manager quotas
Question: What's the difference between an AWS Organizations service control policy and an IAM policy?

What's the difference between an AWS Organizations service control policy (SCPs) and an AWS Identity and Access Management (IAM) policy? How can I use them together?ResolutionAWS Organizations SCPsAWS Organizations SCPs don't replace associating IAM policies within an AWS account.You can use SCPs to allow or deny access to AWS services for individual AWS accounts with AWS Organizations member accounts, or for groups of accounts within an organizational unit (OU). The specified actions from an attached SCP affect all IAM identities including the root user of the member account.AWS services that aren't explicitly allowed by the SCPs associated with an AWS account or its parent OUs are denied access to the AWS accounts or OUs associated with the SCP. SCPs associated to an OU are inherited by all AWS accounts in that OU.For more information, see Example service control policies.IAM policiesIAM policies allow or deny access to AWS services or API actions that work with IAM. An IAM policy can be applied only to IAM identities (users, groups, or roles). IAM policies can't restrict the AWS account root user.For more information, see Example IAM identity-based policies.For more information on how you can use IAM to secure access to your organization, see AWS Identity and Access Management and AWS Organizations.

Related informationTutorial: Creating and configuring an organizationAWS Organizations terminology and concepts
Question: How do I create a read replica for an Amazon RDS DB instance?

I want to scale up a read-heavy database. How do I create a read replica for my Amazon Relational Database Service (Amazon RDS) database instance?ResolutionTo create a read replica, see Creating a read replica. If you use PostgreSQL, see Working with PostgreSQL read replicas in Amazon RDS.Note: Creating a read replica in a different AWS Region can help you serve clients in different geographic regions more quickly. For more information, see Creating a read replica in a different AWS Region.It's a best practice to create a read replica when you don't expect a heavy database load. This is because the read replica creation process might cause I/O latency until it's completed. To reduce I/O latency during read replica creation and on your source RDS DB instance, you can use a High availability (Multi-AZ) for Amazon RDS.Note: To improve performance, configure your read replica so that it's identical to its source database. If you use the Amazon RDS console to create a read replica, the source database settings are used by default.

Related informationWorking with read replicas
Question: Which security protocols and ciphers does CloudFront support?

Which security protocols and ciphers does Amazon CloudFront support?ResolutionFor detailed information on supported cipher and protocol versions, see Supported protocols and ciphers between viewers and CloudFront.The configuration of each protocol version depends on the security policy that's selected. Security policies are pre-made. Specific ciphers suites cannot be added or removed from the security policy that you select. For more information, see Requirements for using SSL/TLS certificates with CloudFront.It's a best practice to use the most secure policy: TLSv1.2_2021. CloudFront attempts to establish the most secure connection. However, the level of security depends on the ciphers and protocols supported by the end user or client.Additionally, a security policy is selected only if a custom SSL certificate is used. If using the default SSL certificate, then the distribution defaults to TLSv1 as its security policy. For more information, see Security Policy.Note: CloudFront uses s2n-tls for Transport Layer Security (TLS) implementation. CloudFront supports TLS versions 1.0, 1.1, 1.2, and 1.3. By default, TLS version 1.3 is enabled on all CloudFront distributions.

Related informationIntroducing s2n-tls, a New Open Source TLS Implementation
Question: How can I share an encrypted Amazon EBS snapshot or volume with another AWS account?

I want to share an Amazon Elastic Block Store (Amazon EBS) snapshot or volume with another AWS account. But, I don't know how.

Short descriptionYou can't directly share an encrypted EBS volume with another AWS account. Instead, you must first create and share an encrypted Amazon EBS snapshot with the other account. Then, create a new volume from the copy of the shared snapshot to share the volume.When sharing EBS snapshots, keep the following in mind:You can't share snapshots that are encrypted with a default AWS Key Management Service (AWS KMS) key. Instead, you must encrypt the snapshot with a customer managed key.You can't share encrypted snapshots publicly. To share a snapshot publicly, make sure that it's not encrypted.For more information, see Before you share a snapshot.

ResolutionNote: To complete the following steps, you must have permissions to edit volumes and snapshots. If you create a volume from an encrypted snapshot but don't see it on the volume list, then you might not have the correct permissions. Also, a snapshot that goes into an error state indicates that there is a permissions issue.Share a snapshot that's encrypted with a customer managed keyTo share a snapshot that's encrypted with a customer managed key, you must share the customer managed key that you used to encrypt the snapshot.First, follow the steps to share a snapshot. Then, follow the steps to share an AWS KMS key.Share a snapshot that's encrypted with a default AWS KMS keyYou can't change a snapshot's default encryption after you create the snapshot. Therefore, to share a snapshot that's encrypted with a default AWS KMS key, you must first create a copy of the snapshot. Then, encrypt the snapshot copy with a customer managed key. For more information, see Encryption and snapshot copying.If you don't have a customer managed key, then see Create an AWS KMS key in a custom key store (console).Share an encrypted EBS volume with another accountTo share an encrypted volume with another account, follow these steps.From the source account:Create a snapshot of the volume.Important: If the EBS volume is attached to an instance, then first stop the instance to maintain data consistency.Complete the steps in the preceding section, Share a snapshot that's encrypted with a customer managed key.From the target account:Create a copy of the shared snapshot.Note: Be sure to select your customer managed key. Otherwise, Amazon EBS encryption uses the default key. For more information on copying a snapshot see, Copy an Amazon EBS snapshot, and review the Prerequisites, Considerations, and Pricing.Create a volume from the snapshot.Note: You can't attach a volume to an Amazon Elastic Compute Cloud (Amazon EC2) instance that's in a different Availability Zone. Therefore, make sure to create the volume in the same Availability Zone where the Amazon EC2 instance is.Important: You can restore snapshots only in the AWS Region where you created the snapshot. For EBS volumes in another Region, copy the snapshot to that Region first, and then restore the snapshot.
Question: How do I run Athena queries for pretty-print JSON files?

When I run Amazon Athena queries on pretty-print JSON files with JSON SerDe, my queries fail with the following error message: "HIVE_CURSOR_ERROR: Row is not a valid JSON Object".

ResolutionAthena JSON SerDe doesn't support pretty-print JSON files, such as the following file:{    "id": "b179db57-9d5b-40c8-8f07-f75bd1fa1b3c",    "random_number": 19,    "categoires": [        "category 1",        "category 2"    ],    "dict": {        "name": "category 1",        "comment": "category 2"    }}{    "id": "bc4624ce-d752-4e38-8a30-42de158dbc50",    "random_number": 95,    "categoires": [        "category 1",        "category 2",        "category 3",        "category 4"    ],    "dict": {        "name": "category 2",        "comment": "category 1"    }}{    "id": "1d3298e8-e3bb-41c0-950c-6a146555ce3c",    "random_number": 89,    "categoires": [        "category 1"    ],    "dict": {        "name": "category 5",        "comment": "category 3"    }}Because Amazon Ion is a superset of JSON, use the Amazon Ion Hive SerDe to query non-Amazon Ion JSON datasets. Unlike other JSON SerDe libraries, the Amazon Ion SerDe doesn't expect each row of data to be on a single line. Use this feature to query JSON datasets that are in pretty print format, or break up the fields in a row with newline characters.1.    Create a table that's similar to the following one with Athena Ion Hive SerDe:CREATE EXTERNAL TABLE table_name (    id string,    random_number int,    categories array<string>,    dict struct<name:string, comment:string>)STORED AS IONLOCATION 's3://sample-bucket/prefix/'2.    Query the table:SELECT * FROM table_nameThe output looks similar to the following output:#idrandom_numbercategoriesdict1b179db57-9d5b-40c8-8f07-f75bd1fa1b3c19[category 1, category 2]{name=category 1, comment=category 2}2bc4624ce-d752-4e38-8a30-42de158dbc5095[category 1, category 2, category 3, category 4]{name=category 2, comment=category 1}31d3298e8-e3bb-41c0-950c-6a146555ce3c89[category 1]{name=category 5, comment=category 3}Related informationWhy do I get errors when I try to read JSON data in Amazon Athena?
Question: Why did my Amazon RDS DB instance fail over?

My Amazon Relational Database Service (Amazon RDS) DB instance failed over. How do I identify why the DB instance failed over?Short DescriptionIf there is a planned or an unplanned outage for a Multi-AZ DB instance, Amazon RDS automatically switches to a standby replica or secondary instance in another Availability Zone. Depending on your database activity at the time of the time of the outage, failover usually lasts between 60-120 seconds. For more information, see Failover Process for Amazon RDS.

ResolutionTo see if a failover has occurred, open the Amazon RDS console, and then choose Events from the navigation pane. If AWS CloudTrail logging is enabled, then you can check the logs to see whether the event was planned or unplanned. For example, scaling compute or applying pending OS upgrades can trigger a failover.If there are no events listed and there are no CloudTrail logs, the failover might be caused by one of the following:Availability Zone failuresPrimary DB instance compute node failuresNetworking issues with the primary DB instanceStorage or Amazon Elastic Block Store (Amazon EBS) volume issuesWhen these types of unplanned outages occur, Amazon RDS monitors and identifies the issue. Then, Amazon RDS fails over automatically to minimize downtime.Related InformationBest Practices for Amazon RDS
Question: How do I change the email address that's associated with my AWS account?

I want to change the email address that's associated with the AWS account root user of my account.

ResolutionYou can change the AWS account root user email associated with an AWS account only after you sign in as that user.If you sign in as an AWS Identity and Access Management (IAM) user and you want to change your user name, contact your account administrator. Ask your account administrator to follow the instructions at Renaming an IAM user.Important: If your Amazon.com retail and AWS accounts share the same log-in information, then updating the email address for one account also changes the other account.To update your root email address, do the following:Log in as a root user to the Billing and Cost Management console for the AWS account that you want to update.If you're already logged in to the console and don't see your account information: select your account ID at the upper-right corner of the screen, and then select Account from the dropdown list.Choose Edit next to Account Settings.Note: If you aren't logged in as a root user, then you won't see the Edit option.Update your email address associated to your account.Note: You can't use an email address that is already in use on another Amazon.com or AWS account.Choose Done.To update the account name or root user password associated with an AWS account, see Managing an AWS account.

Related informationWhat is AWS Billing?How do I update the address associated with my AWS account?How do I update my telephone number associated with my AWS account?Accessing and administering the member accounts in your organization
Question: How do I restore my deleted Amazon EBS volume or snapshot?

I want to restore my Amazon Elastic Block Store (Amazon EBS) volume or snapshot that I deleted, but I don't know how.

ResolutionAfter you delete an Amazon EBS volume, you can't restore the volume. If you created an Amazon EBS snapshot of the volume, then you can use the snapshot to recreate the volume to recover the data. It's a best practice to create snapshots of your volumes to prevent data loss when you delete a volume.If you deleted your snapshot, then you can recover it only if you activated Recycle Bin in the AWS Region where your resources are.Refer to the following documentation to restore your snapshot from the Recycle Bin:ConsiderationsPermissions for working with snapshots in the Recycle BinRestore snapshots from the Recycle BinAfter you restore the snapshot from the Recycle Bin, you can create a volume from the snapshot to recover the volume's data.
Question: How can I grant a user in another AWS account the access to upload objects to my Amazon S3 bucket?

I want to grant an AWS Identity and Access Management (IAM) user in another account access to my Amazon Simple Storage Service (Amazon S3) bucket. The user is trying to upload objects to my Amazon S3 bucket. How can I grant this cross-account access?ResolutionFollow these steps to grant an IAM user from Account A the access to upload objects to an S3 bucket in Account B:1.    From Account A, attach a policy to the IAM user. The policy must allow the user to run the s3:PutObject and s3:PutObjectAcl actions on the bucket in Account B.For example:{    "Version": "2012-10-17",    "Statement": [        {            "Effect": "Allow",            "Action": [                "s3:PutObject",                "s3:PutObjectAcl"                  ],            "Resource": [                "arn:aws:s3:::DOC-EXAMPLE-BUCKET",                "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*"            ]        }    ]}Note: The s3:PutObjectAcl permission is required for users that must specify an object access control list (ACL) during upload. Without this permission, users get an Access Denied error when they upload an object with an ACL (such as the bucket-owner-full control ACL).2.    From Account A, get the Amazon Resource Name (ARN) of the IAM user.3.    From Account B, attach a bucket policy that grants the IAM user in Account A permission to run s3:PutObject and s3:PutObjectAcl actions:{    "Version": "2012-10-17",    "Statement": [        {            "Sid": "DelegateS3Access",            "Effect": "Allow",            "Principal": {"AWS": "arn:aws:iam::999999999999:user/UploadData"},            "Action": ["s3:PutObject", "s3:PutObjectAcl"],            "Resource": [                "arn:aws:s3:::DOC-EXAMPLE-BUCKET",                "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*"            ]        }    ]}Important: For the value of Principal, be sure to enter the ARN of the IAM user in Account A.After you set up the IAM user policy in Account A and bucket policy in Account B, the IAM user can upload objects to Amazon S3.

Related informationExample 2: Bucket owner granting cross-account bucket permissions
Question: How do I add a new payment method to my AWS account?

I want to change the default payment method for my AWS account.

ResolutionFirst, be sure that your payment method is accepted. For more information, see What payment methods does AWS accept?If your account is with AWS, then see Managing your AWS payments. For information on adding a payment method, see Managing your credit card payment preferences and Managing your ACH direct debit payment methods.If your account is with AWS India, then see Managing your payments in India. To use a credit card as your payment method, see Make a payment using a credit or debit card. To add a net banking account to your AWS India account, see Add a net banking account.If your account is with AWS Europe, then see Managing your payments in AWS Europe. To add a credit card to your account, see Managing your AWS Europe credit card payment methods.AWS automatically charges your default payment method each month. AWS India customers pay their bill manually on the Payments pane of the Billing and Cost Management console each month.To change your default payment method, see How do I change the default payment method associated with my AWS account?