0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Last updated at Posted at 2017-08-07

この記事について

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.

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?