Skip to content

Commit

Permalink
small updates to terraform path stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandeivert committed Mar 18, 2020
1 parent 7f3aa10 commit 272b05b
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 234 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ docs/build
__pycache__

# Terraform files
*.terraform/
terraform.tfvars
terraform/terraform.tfstate*
terraform/*.zip
terraform/*.tf.json
streamalert_cli/_infrastructure/.terraform/
streamalert_cli/_infrastructure/terraform.tfvars
streamalert_cli/_infrastructure/terraform.tfstate*
streamalert_cli/_infrastructure/*.zip
streamalert_cli/_infrastructure/*.tf.json

# Coveralls repo token
.coveralls.yml
Expand Down
18 changes: 18 additions & 0 deletions streamalert_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import os

STREAMALERT_CLI_ROOT = os.path.dirname(os.path.abspath(__file__))
Binary file removed streamalert_cli/_infrastructure/alert_merger.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed streamalert_cli/_infrastructure/classifier.zip
Binary file not shown.
203 changes: 0 additions & 203 deletions streamalert_cli/_infrastructure/main.tf.json

This file was deleted.

4 changes: 2 additions & 2 deletions streamalert_cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from botocore.exceptions import ClientError, NoCredentialsError

from streamalert.shared.logger import get_logger
from streamalert_cli.terraform.common import DEFAULT_TERRAFORM_FILES_PATH
from streamalert_cli.terraform import TERRAFORM_FILES_PATH

LOGGER = get_logger(__name__)

Expand All @@ -50,7 +50,7 @@ def run_command(runner_args, **kwargs):
"""
default_error_message = "An error occurred while running: {}".format(' '.join(runner_args))
error_message = kwargs.get('error_message', default_error_message)
cwd = kwargs.get('cwd', DEFAULT_TERRAFORM_FILES_PATH)
cwd = kwargs.get('cwd', TERRAFORM_FILES_PATH)

# Add the -force-copy flag for s3 state copying to suppress dialogs that
# the user must type 'yes' into.
Expand Down
4 changes: 2 additions & 2 deletions streamalert_cli/manage_lambda/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from streamalert.shared.logger import get_logger
from streamalert_cli.helpers import run_command
from streamalert_cli.terraform.common import DEFAULT_TERRAFORM_FILES_PATH
from streamalert_cli.terraform import TERRAFORM_FILES_PATH

LOGGER = get_logger(__name__)

Expand Down Expand Up @@ -83,7 +83,7 @@ def create(self):

# Zip up files
result = shutil.make_archive(
os.path.join(DEFAULT_TERRAFORM_FILES_PATH, self.package_name), 'zip', temp_package_path)
os.path.join(TERRAFORM_FILES_PATH, self.package_name), 'zip', temp_package_path)
LOGGER.info('Successfully created %s', os.path.basename(result))

# Remove temp files
Expand Down
5 changes: 5 additions & 0 deletions streamalert_cli/terraform/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import os

from streamalert_cli import STREAMALERT_CLI_ROOT

TERRAFORM_FILES_PATH = os.path.join(STREAMALERT_CLI_ROOT, '_infrastructure')
2 changes: 0 additions & 2 deletions streamalert_cli/terraform/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
"""
from collections import defaultdict


DEFAULT_SNS_MONITORING_TOPIC_SUFFIX = '{}_streamalert_monitoring'
DEFAULT_S3_LOGGING_BUCKET_SUFFIX = '{}-streamalert-s3-logging'
DEFAULT_TERRAFORM_STATE_BUCKET_SUFFIX = '{}-streamalert-terraform-state'
DEFAULT_TERRAFORM_FILES_PATH = 'streamalert_cli/_infrastructure'


class InvalidClusterName(Exception):
Expand Down
Loading

0 comments on commit 272b05b

Please sign in to comment.