Skip to content

Commit

Permalink
Merge pull request #46 from srinivasreddych/feat/efs
Browse files Browse the repository at this point in the history
efs license headers and exception handling
  • Loading branch information
srinivasreddych authored Aug 22, 2023
2 parents fe45f0c + 8f27585 commit 0942182
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
9 changes: 6 additions & 3 deletions modules/storage/efs/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 @@ -16,13 +19,13 @@
efs_removal_policy = os.getenv("SEEDFARMER_PARAMETER_RETENTION_TYPE", "DESTROY")

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 not vpc_id:
raise Exception("missing input parameter vpc-id")
raise ValueError("missing input parameter vpc-id")

if efs_removal_policy 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' ")

app = App()

Expand Down
3 changes: 3 additions & 0 deletions modules/storage/efs/stack.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
from typing import Any, cast

Expand Down
15 changes: 2 additions & 13 deletions modules/storage/efs/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/efs/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 0942182

Please sign in to comment.