Skip to content

Commit

Permalink
license headers and exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddych committed Aug 22, 2023
1 parent dec6398 commit c05d07b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 42 deletions.
9 changes: 6 additions & 3 deletions modules/storage/buckets/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os

import aws_cdk
Expand All @@ -18,14 +21,14 @@
app = App()

if len(f"{project_name}-{deployment_name}") > 36:
raise Exception("This module cannot support a project+deployment name character length greater than 35")
raise ValueError("This module cannot support a project+deployment name character length greater than 35")

if buckets_retention not in ["DESTROY", "RETAIN"]:
raise Exception("The only RETENTION_TYPE values accepted are 'DESTROY' and 'RETAIN' ")
raise ValueError("The only RETENTION_TYPE values accepted are 'DESTROY' and 'RETAIN' ")


if buckets_encryption_type not in ["SSE", "KMS"]:
raise Exception("The only ENCRYPTION_TYPE values accepted are 'SSE' and 'KMS' ")
raise ValueError("The only ENCRYPTION_TYPE values accepted are 'SSE' and 'KMS' ")

stack = BucketsStack(
scope=app,
Expand Down
15 changes: 2 additions & 13 deletions modules/storage/buckets/stack.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import hashlib
import logging
Expand Down
15 changes: 2 additions & 13 deletions modules/storage/buckets/tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import sys
Expand Down
15 changes: 2 additions & 13 deletions modules/storage/buckets/tests/test_stack.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import os
import sys
Expand Down

0 comments on commit c05d07b

Please sign in to comment.