Skip to content

Commit

Permalink
Fix Amazon MQ urls (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
guikcd authored Feb 15, 2022
1 parent fb94134 commit fc79610
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from jinja2 import Template

GENERATION_DATE = datetime.datetime.now()
VERSION = "0.6"
VERSION = "0.7"

ELASTICACHE_ENGINES = ["memcached", "redis"]

Expand All @@ -41,7 +41,8 @@
"sqlserver-ex": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html",
"sqlserver-se": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html",
"sqlserver-web": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html",
"mq": "https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/supported-engine-versions.html",
"activemq": "https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/activemq-version-management.html",
"rabbitmq": "https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-version-management.html",
"cassandra": "https://docs.aws.amazon.com/keyspaces/latest/devguide/keyspaces-vs-cassandra.html",
"lightsail_app": "https://lightsail.aws.amazon.com/ls/docs/en_us/articles/compare-options-choose-lightsail-instance-image",
"lightsail_database": "https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-choosing-a-database",
Expand Down Expand Up @@ -81,6 +82,22 @@
ALL_ENGINES["DBEngineVersions"] = engines


def check_urls():
"""
test that versions urls to service documentation has not changed
"""
# want to get the service
for service, url in VERSION_URL_DETAIL.items():
response = requests.get(url, allow_redirects=False)
if response.status_code != 200:
logging.warning(
"Service %s URL return %s instead of 200 (%s)",
service,
response.status_code,
url,
)


def rds_engines(data=None):
"""
RDS
Expand Down Expand Up @@ -333,9 +350,11 @@ def lambda_handler(
)

for version in mq_versions(engine="ACTIVEMQ"):
versions += version_table_row("Amazon MQ for Apache ActiveMQ", version, "mq")
versions += version_table_row(
"Amazon MQ for Apache ActiveMQ", version, "activemq"
)
for version in mq_versions(engine="RABBITMQ"):
versions += version_table_row("Amazon MQ for RabbitMQ", version, "mq")
versions += version_table_row("Amazon MQ for RabbitMQ", version, "rabbitmq")

for version in opensearch_versions():
versions += version_table_row(
Expand Down Expand Up @@ -415,4 +434,5 @@ def lambda_handler(


if __name__ == "__main__":
check_urls()
lambda_handler({"event": 1}, "")

0 comments on commit fc79610

Please # to comment.