Skip to content

Commit

Permalink
lock proper versions
Browse files Browse the repository at this point in the history
  • Loading branch information
willronchetti committed Apr 1, 2024
1 parent fa67f96 commit b22c13b
Show file tree
Hide file tree
Showing 4 changed files with 1,310 additions and 1,069 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
Change Log
----------

4.1.2
=====

* Update redis layer to pass encryption options (previously unsupported)


4.1.1
=====

Expand Down
2,325 changes: 1,281 additions & 1,044 deletions poetry.lock

Large diffs are not rendered by default.

20 changes: 8 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "4dn-cloud-infra"
version = "4.1.1"
version = "4.1.2"
description = "Repository for generating Cloudformation Templates to orchestrate the CGAP Ecosystem"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand All @@ -12,9 +12,9 @@ packages = [
# Chalice is problematic with Python 3.11 (cffi package won't install and required at run-time).
python = ">=3.8,<3.11"
awacs = "^2.0.0"
awscli = "^1.29.62"
boto3 = "^1.28.62"
botocore = "^1.31.62"
awscli = "^1.32.74"
boto3 = "^1.34.74"
botocore = "^1.34.74"
chalice = "^1.29.0"
cffi = "^1.15.1"
dcicutils = "^8.0.0"
Expand All @@ -29,37 +29,33 @@ prettytable = "3.3.0"
tibanna = "^5.1.0"
tibanna-ff = "^3.1.1"
tqdm = ">=4.62.3"
troposphere = "^3.2.2"
troposphere = "^4.7.0"

# Foursight ...

foursight-core = "^5.1.0"
#foursight-core = "5.1.0.1b1"

# Define poetry "groups" for foursight-cgap and foursight, named foursight_cgap and
# foursight_fourfront, respectively. This is so we can conditionally include either but
# not both in the Chalice package (via foursight_core/deploy.py). dmichaels/2022-11-01.

[tool.poetry.group.foursight_smaht.dependencies]
foursight-smaht = "^0.3.0"
#foursight-smaht = "0.3.0.1b1"
foursight-smaht = "^0.8.1"

[tool.poetry.group.foursight_cgap.dependencies]
foursight-cgap = "^4.1.0"
#foursight-cgap = "4.1.0.1b2"

[tool.poetry.group.foursight_fourfront.dependencies]
foursight = "^4.1.0"
#foursight = "4.1.0.1b1"

[tool.poetry.dev-dependencies]
jupyter = "1.0.0"
#numpy = "1.21.6" # added to allow to lock, last viable version for 3.7 - Will July 21 2022
#pandas = "1.3.5" # added to allow to lock, last viable version for 3.7 - Will July 21 2022
cfn-flip = "1.2.3" # do we need to specify this explicitly? -kmp 27-Jul-2021
cfn-lint = "0.48.3" # a secondary check that catches more things than standard validate - Will 4/1/2021
boto3-stubs = "^1.28.62"
botocore-stubs = "^1.31.62"
boto3-stubs = "^1.34.69"
botocore-stubs = "^1.34.69"
# Linting generally
flake8 = ">=3.9.2"
mock = "^4.0.3"
Expand Down
28 changes: 15 additions & 13 deletions src/parts/redis.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from troposphere import Ref, Template, Parameter, Output, GetAtt
from troposphere.elasticache import CacheCluster, SubnetGroup, SecurityGroup, SecurityGroupIngress
from troposphere import Ref, Template, Parameter, Output
from troposphere.elasticache import CacheCluster, SubnetGroup, ReplicationGroup
from dcicutils.cloudformation_utils import camelize

from .network import C4NetworkExports, C4Network
from .network import C4NetworkExports
from ..base import ConfigManager
from ..constants import Settings
from ..exports import C4Exports
Expand Down Expand Up @@ -38,8 +38,8 @@ def build_template(self, template: Template) -> Template:

# Build Redis Cluster
template.add_resource(self.build_redis_subnet_group())
cluster = template.add_resource(self.build_redis_cache_cluster())
template.add_output(self.output_redis_endpoint(cluster))
replication_group = self.build_redis_replication_group()
template.add_resource(replication_group)
return template

@staticmethod
Expand All @@ -66,23 +66,25 @@ def build_redis_subnet_group(self) -> SubnetGroup:
Tags=self.tags.cost_tag_obj(),
)

def build_redis_cache_cluster(self) -> CacheCluster:
""" Builds a Redis cluster in the ElastiCache paradigm """
def build_redis_replication_group(self) -> ReplicationGroup:
""" Pass additional security settings to Redis via Replication Group """
env_name = ConfigManager.get_config_setting(Settings.ENV_NAME)
logical_id = self.name.logical_id(self.redis_cluster_name(env_name))
# TODO: add back encryption options once they are supported.
return CacheCluster(
return ReplicationGroup(
logical_id,
AutomaticFailoverEnabled=False,
ReplicationGroupDescription='Pass additional options to the Redis Cluster',
AtRestEncryptionEnabled=True,
TransitEncryptionEnabled=True,
AutoMinorVersionUpgrade=True,
ClusterName=logical_id,
Engine=self.DEFAULT_ENGINE,
EngineVersion=ConfigManager.get_config_setting(Settings.REDIS_ENGINE_VERSION,
default=self.DEFAULT_ENGINE_VERSION),
NumCacheNodes=ConfigManager.get_config_setting(Settings.REDIS_NODE_COUNT,
default=self.DEFAULT_NODE_COUNT),
NumCacheClusters=ConfigManager.get_config_setting(Settings.REDIS_NODE_COUNT,
default=self.DEFAULT_NODE_COUNT),
CacheNodeType=ConfigManager.get_config_setting(Settings.REDIS_NODE_TYPE,
default=self.DEFAULT_CACHE_NODE_TYPE),
CacheSubnetGroupName=Ref(self.build_redis_subnet_group()),
VpcSecurityGroupIds=[self.NETWORK_EXPORTS.import_value(C4NetworkExports.APPLICATION_SECURITY_GROUP)],
SecurityGroupIds=[self.NETWORK_EXPORTS.import_value(C4NetworkExports.APPLICATION_SECURITY_GROUP)],
Tags=self.tags.cost_tag_obj(),
)

0 comments on commit b22c13b

Please sign in to comment.