{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/streamalert/issues/469","repository_url":"https://api.github.com/repos/airbnb/streamalert","labels_url":"https://api.github.com/repos/airbnb/streamalert/issues/469/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/streamalert/issues/469/comments","events_url":"https://api.github.com/repos/airbnb/streamalert/issues/469/events","html_url":"https://github.com/airbnb/streamalert/issues/469","id":273558068,"number":469,"title":"BucketRegionError: incorrect region, the bucket is not in 'ap-southeast-1' region","user":{"login":"scrapbird","id":2077061,"avatar_url":"https://avatars3.githubusercontent.com/u/2077061?v=4","gravatar_id":"","url":"https://api.github.com/users/scrapbird","html_url":"https://github.com/scrapbird","followers_url":"https://api.github.com/users/scrapbird/followers","following_url":"https://api.github.com/users/scrapbird/following{/other_user}","gists_url":"https://api.github.com/users/scrapbird/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapbird/subscriptions","organizations_url":"https://api.github.com/users/scrapbird/orgs","repos_url":"https://api.github.com/users/scrapbird/repos","events_url":"https://api.github.com/users/scrapbird/events{/privacy}","received_events_url":"https://api.github.com/users/scrapbird/received_events","type":"User","site_admin":false},"labels":[{"id":528377053,"url":"https://api.github.com/repos/airbnb/streamalert/labels/build/test","name":"build/test","color":"fef2c0","default":false},{"id":528375308,"url":"https://api.github.com/repos/airbnb/streamalert/labels/terraform","name":"terraform","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-13T19:58:49Z","updated_at":"2017-11-13T20:57:54Z","closed_at":null,"author_association":"NONE","body":"## Background\r\n\r\nWhen attempting to run `python manage.py terraform init` and specifying the ap-southeast-2 region I get the following error:\r\n\r\n> StreamAlertCLI [INFO]: Issues? Report here: https://github.com/airbnb/streamalert/issues\r\n> \r\n> Are you sure you want to destroy? (yes or no): yes\r\n> Downloading modules...\r\n> \r\n> Initializing the backend...\r\n> \r\n> Initializing provider plugins...\r\n> \r\n> Terraform has been successfully initialized!\r\n> \r\n> You may now begin working with Terraform. Try running \"terraform plan\" to see\r\n> any changes that are required for your infrastructure. All Terraform commands\r\n> should now work.\r\n> \r\n> If you ever set or change modules or backend configuration for Terraform,\r\n> rerun this command to reinitialize your working directory. If you forget, other\r\n> commands will detect it and remind you to do so if necessary.\r\n> StreamAlertCLI [INFO]: Planning infrastructure\r\n> provider.aws.region\r\n>   The region where AWS operations will take place. Examples\r\n>   are us-east-1, us-west-2, etc.\r\n> \r\n>   Default: us-east-1\r\n>   Enter a value: ap-southeast-1\r\n> \r\n> Refreshing Terraform state in-memory prior to plan...\r\n> The refreshed state will be used to calculate this plan, but will not be\r\n> persisted to local or remote state storage.\r\n> \r\n> aws_s3_bucket.streamalerts: Refreshing state... (ID: [REDACTED].streamalerts)\r\n> aws_s3_bucket.logging_bucket: Refreshing state... (ID: [REDACTED].streamalert.s3-logging)\r\n> aws_s3_bucket.terraform_remote_state: Refreshing state... (ID: [REDACTED].streamalert.terraform.state)\r\n> aws_s3_bucket.stream_alert_secrets: Refreshing state... (ID: [REDACTED].streamalert.secrets)\r\n> aws_kms_key.stream_alert_secrets: Refreshing state... (ID: 7c7fe52f-531c-410f-bb8e-0702c4e5b9d1)\r\n> aws_s3_bucket.lambda_source: Refreshing state... (ID: [REDACTED].streamalert.source)\r\n> aws_kms_alias.stream_alert_secrets: Refreshing state... (ID: alias/stream_alert_secrets)\r\n> data.aws_iam_policy_document.alert_processor_cloudwatch: Refreshing state...\r\n> data.aws_iam_policy_document.lambda_assume_role_policy: Refreshing state...\r\n> data.aws_iam_policy_document.rule_processor_invoke_alert_proc: Refreshing state...\r\n> data.aws_iam_policy_document.streamalert_rule_processor_firehose: Refreshing state...\r\n> data.aws_iam_policy_document.alert_processor_s3: Refreshing state...\r\n> data.aws_iam_policy_document.streamalert_cloudwatch_role_assume_role_policy: Refreshing state...\r\n> data.aws_iam_policy_document.cloudtrail_bucket: Refreshing state...\r\n> Error refreshing state: 5 error(s) occurred:\r\n> \r\n> * aws_s3_bucket.terraform_remote_state: 1 error(s) occurred:\r\n> \r\n> * aws_s3_bucket.terraform_remote_state: aws_s3_bucket.terraform_remote_state: error reading S3 bucket \"[REDACTED].streamalert.terraform.state\": BucketRegionError: incorrect region, the bucket is not in 'ap-southeast-1' region\r\n> \tstatus code: 301, request id: , host id:\r\n> * aws_s3_bucket.stream_alert_secrets: 1 error(s) occurred:\r\n> \r\n> * aws_s3_bucket.stream_alert_secrets: aws_s3_bucket.stream_alert_secrets: error reading S3 bucket \"[REDACTED].streamalert.secrets\": BucketRegionError: incorrect region, the bucket is not in 'ap-southeast-1' region\r\n> \tstatus code: 301, request id: , host id:\r\n> * aws_s3_bucket.lambda_source: 1 error(s) occurred:\r\n> \r\n> * aws_s3_bucket.lambda_source: aws_s3_bucket.lambda_source: error reading S3 bucket \"[REDACTED].streamalert.source\": BucketRegionError: incorrect region, the bucket is not in 'ap-southeast-1' region\r\n> \tstatus code: 301, request id: , host id:\r\n> * aws_s3_bucket.logging_bucket: 1 error(s) occurred:\r\n> \r\n> * aws_s3_bucket.logging_bucket: aws_s3_bucket.logging_bucket: error reading S3 bucket \"[REDACTED].streamalert.s3-logging\": BucketRegionError: incorrect region, the bucket is not in 'ap-southeast-1' region\r\n> \tstatus code: 301, request id: , host id:\r\n> * aws_s3_bucket.streamalerts: 1 error(s) occurred:\r\n> \r\n> * aws_s3_bucket.streamalerts: aws_s3_bucket.streamalerts: error reading S3 bucket \"[REDACTED].streamalerts\": BucketRegionError: incorrect region, the bucket is not in 'ap-southeast-1' region\r\n> \tstatus code: 301, request id: , host id:\r\n> StreamAlertCLI [ERROR]: An error occurred while running: terraform plan -var-file=../conf/lambda.json -destroy\r\n> ['terraform', 'plan', '-var-file=../conf/lambda.json', '-destroy']\r\n> StreamAlertCLI [INFO]: Completed\r\n\r\nThis leaves S3 buckets in my account but when attempting `python manage.py terraform destroy` it throws the same error and does not remove anything.\r\n\r\n## Desired Change\r\n\r\nThis should support more than just the default us-east-1 region.\r\n"},"comment":{"url":"https://api.github.com/repos/airbnb/streamalert/issues/comments/344055552","html_url":"https://github.com/airbnb/streamalert/issues/469#issuecomment-344055552","issue_url":"https://api.github.com/repos/airbnb/streamalert/issues/469","id":344055552,"user":{"login":"jacknagz","id":11466941,"avatar_url":"https://avatars1.githubusercontent.com/u/11466941?v=4","gravatar_id":"","url":"https://api.github.com/users/jacknagz","html_url":"https://github.com/jacknagz","followers_url":"https://api.github.com/users/jacknagz/followers","following_url":"https://api.github.com/users/jacknagz/following{/other_user}","gists_url":"https://api.github.com/users/jacknagz/gists{/gist_id}","starred_url":"https://api.github.com/users/jacknagz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacknagz/subscriptions","organizations_url":"https://api.github.com/users/jacknagz/orgs","repos_url":"https://api.github.com/users/jacknagz/repos","events_url":"https://api.github.com/users/jacknagz/events{/privacy}","received_events_url":"https://api.github.com/users/jacknagz/received_events","type":"User","site_admin":false},"created_at":"2017-11-13T20:57:54Z","updated_at":"2017-11-13T20:57:54Z","author_association":"CONTRIBUTOR","body":"@scrapbird can you give some more context?\r\n\r\nThe paste you provided looks like a destroy and not an init.  Which regions are the buckets in? "}}
{"actor":{"display_login":"jacknagz"}}