Help us understand the problem. What is going on with this article?

[JAWS-UG CLI] Amazon Kinesis Firehose re:入門 (5) Delivery Streamの削除

More than 3 years have passed since last update.

この記事について

JAWS-UG CLI専門支部 #90 Kinesis Firehose 復習編で実施するハンズオン用の手順書です。

前提条件

必要な権限

作業にあたっては、以下の権限を有したIAMユーザもしくはIAMロールを利用してください。

  • 以下のサービスに対するフルコントロール権限
    • Kinesis Firehose
    • IAM
    • EC2
    • S3
    • CloudWatch Logs
    • STS
    • (Lambda)
      • データの変換を行う場合
    • (KMS)
      • データの暗号化を行う場合

0. 準備

0.1. リージョンを指定

オレゴンリージョンで実施します。(東京マダー?)

コマンド
export AWS_DEFAULT_REGION="us-west-2"

0.2. 資格情報を確認

コマンド
aws configure list

インスタンスプロファイルを設定したEC2インスタンスでアクセスキーを設定せずに実行した場合、以下のようになります。

結果
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************QSAA         iam-role
secret_key     ****************c1xY         iam-role
    region                us-west-2              env    AWS_DEFAULT_REGION

0.3. バージョン確認

コマンド
aws --version
結果
aws-cli/1.11.129 Python/2.7.12 Linux/4.9.38-16.33.amzn1.x86_64 botocore/1.5.92

0.4. バージョンアップ(必要に応じて)

コマンド
sudo pip install -U awscli

0.5. 変数の確認

コマンド
cat << ETX

    DELIVERY_STREAM_NAME: ${DELIVERY_STREAM_NAME}

ETX

1. Delivery Streamの削除

1.1. Delivery Streamの削除

Delivery Stream名の確認

コマンド
cat << ETX

    DELIVERY_STREAM_NAME: ${DELIVERY_STREAM_NAME}

ETX
結果
    DELIVERY_STREAM_NAME: jawsug-cli-stream

Delivery Streamの確認

コマンド
aws firehose describe-delivery-stream \
    --delivery-stream-name ${DELIVERY_STREAM_NAME}
結果
{
    "DeliveryStreamDescription": {
        "HasMoreDestinations": false,
        "LastUpdateTimestamp": 1502033993.512,
        "VersionId": "2",
        "CreateTimestamp": 1502033075.665,
        "DeliveryStreamARN": "arn:aws:firehose:us-west-2:XXXXXXXXXXXX:deliverystream/jawsug-cli-stream",
        "DeliveryStreamStatus": "ACTIVE",
        "DeliveryStreamName": "jawsug-cli-stream",
        "Destinations": [
            {
                "DestinationId": "destinationId-000000000001",
                "ExtendedS3DestinationDescription": {
                    "RoleARN": "arn:aws:iam::XXXXXXXXXXXX:role/service-role-firehose",
                    "Prefix": "",
                    "BufferingHints": {
                        "IntervalInSeconds": 60,
                        "SizeInMBs": 1
                    },
                    "EncryptionConfiguration": {
                        "NoEncryptionConfig": "NoEncryption"
                    },
                    "CompressionFormat": "UNCOMPRESSED",
                    "S3BackupMode": "Disabled",
                    "CloudWatchLoggingOptions": {
                        "Enabled": true,
                        "LogStreamName": "S3Delivery",
                        "LogGroupName": "/aws/kinesisfirehose/jawsug-cli-stream"
                    },
                    "BucketARN": "arn:aws:s3:::firehose-jawsug-cli-s3bucket-1qtuo76w7zanq",
                    "ProcessingConfiguration": {
                        "Enabled": true,
                        "Processors": [
                            {
                                "Type": "Lambda",
                                "Parameters": [
                                    {
                                        "ParameterName": "NumberOfRetries",
                                        "ParameterValue": "3"
                                    },
                                    {
                                        "ParameterName": "LambdaArn",
                                        "ParameterValue": "arn:aws:lambda:us-west-2:XXXXXXXXXXXX:function:test-func-apache2json:$LATEST"
                                    }
                                ]
                            }
                        ]
                    }
                },
                "S3DestinationDescription": {
                    "RoleARN": "arn:aws:iam::XXXXXXXXXXXX:role/service-role-firehose",
                    "Prefix": "",
                    "BufferingHints": {
                        "IntervalInSeconds": 60,
                        "SizeInMBs": 1
                    },
                    "EncryptionConfiguration": {
                        "NoEncryptionConfig": "NoEncryption"
                    },
                    "CompressionFormat": "UNCOMPRESSED",
                    "CloudWatchLoggingOptions": {
                        "Enabled": true,
                        "LogStreamName": "S3Delivery",
                        "LogGroupName": "/aws/kinesisfirehose/jawsug-cli-stream"
                    },
                    "BucketARN": "arn:aws:s3:::firehose-jawsug-cli-s3bucket-1qtuo76w7zanq"
                }
            }
        ]
    }
}

Delivery Streamの削除

コマンド
aws firehose delete-delivery-stream \
    --delivery-stream-name ${DELIVERY_STREAM_NAME}

Delivery Streamの確認

完全に削除が完了するまで、数分かかります。しばらくお待ち下さい。

コマンド
aws firehose describe-delivery-stream \
    --delivery-stream-name ${DELIVERY_STREAM_NAME}
結果
An error occurred (ResourceNotFoundException) when calling the DescribeDeliveryStream operation: Firehose jawsug-cli-stream under account XXXXXXXXXXXX not found.

以上

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした