

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# CloudFormation を使用した Amazon SQS キューの作成
<a name="create-queue-cloudformation"></a>

CloudFormation コンソールと JSON または YAML テンプレートを使用して Amazon SQS キューを作成します。詳細については、「*AWS CloudFormation ユーザーガイド*」の「[CloudFormation テンプレート](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-guide.html)および [`AWS::SQS::Queue` リソースの使用](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sqs-queue.html)」を参照してください。

**CloudFormationAmazon SQS キューを作成するための使用方法。**

1. 次のJSON コードを`MyQueue.json`という名前のファイルにコピーします。標準キューを作成するには、`FifoQueue` および`ContentBasedDeduplication`プロパティを省略します。コンテンツベースの重複排除の詳細については、「[Amazon SQS の 1 回のみ処理](FIFO-queues-exactly-once-processing.md)」を参照してください。
**注記**  
FIFOキューの名前は`.fifo`のサフィックスで終わる必要があります。

   ```
   {
      "AWSTemplateFormatVersion": "2010-09-09",
      "Resources": {
         "MyQueue": {
            "Properties": {
               "QueueName": "MyQueue.fifo",
               "FifoQueue": true,
               "ContentBasedDeduplication": true
                },
            "Type": "AWS::SQS::Queue"
            }
         },
      "Outputs": {
         "QueueName": {
            "Description": "The name of the queue",
            "Value": {
               "Fn::GetAtt": [
                  "MyQueue",
                  "QueueName"
               ]
            }
         },
         "QueueURL": {
            "Description": "The URL of the queue",
            "Value": {
               "Ref": "MyQueue"
            }
         },
         "QueueARN": {
            "Description": "The ARN of the queue",
            "Value": {
               "Fn::GetAtt": [
                  "MyQueue",
                  "Arn"
               ]
            }
         }
      }
   }
   ```

1. [CloudFormation コンソール](https://console.aws.amazon.com/cloudformation) にサインインし、続いて [**スタックの作成**] を選択します。

1. [**Specify Template**] パネルで、[**Upload a template file**]、`MyQueue.json` ファイル、[**次へ**] の順に選択します。

1. \$1**詳細を指定する**\$1 ページで、[`MyQueue`スタック名**] に ** を入力してから、(**次へ**) を選択します。

1. [**オプション**] ページで、[**次へ**] を選択します。

1. [**Review**] ページで、[**作成**] を選択します。

   CloudFormationは`MyQueue`スタックの作成を開始し、[**CREATE\$1IN\$1PROGRESS**] のステータスが表示されます。プロセスが完了すると、CloudFormationに [**CREATE\$1COMPLETE**]ステータスが表示されます。  
![\[CREATE_COMPLETE ステータスを表示する CloudFormation コンソール。\]](http://docs.aws.amazon.com/ja_jp/AWSSimpleQueueService/latest/SQSDeveloperGuide/images/sqs-tutorials-creating-queue-cfn-create-complete.png)

1. (オプション) キューの名前、URL、ARN を表示するには、スタックの名前を選択し、次のページで [**出力**] セクションを展開します。