Admin: Improve automatic resource updates (#5988)
This commit is contained in:
parent
b696a283be
commit
651722689f
@ -9,7 +9,7 @@ name: "DataUpdate_EC2InstanceOfferings"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '00 12 * * 0'
|
||||
- cron: '00 6 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@ -40,12 +40,11 @@ jobs:
|
||||
- name: Pull EC2 instance types from AWS
|
||||
uses: technote-space/create-pr-action@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
|
||||
EXECUTE_COMMANDS: |
|
||||
pip install boto3
|
||||
scripts/ec2_get_instance_type_offerings.py
|
||||
COMMIT_MESSAGE: 'chore: update EC2 Instance Offerings'
|
||||
COMMIT_NAME: 'Moto Admin'
|
||||
COMMIT_EMAIL: 'admin@getmoto.org'
|
||||
PR_BRANCH_NAME: 'chore-update-ec2-offerings-${PR_ID}'
|
||||
PR_BRANCH_NAME: 'chore-update-ec2-offerings-${{ github.run_number }}'
|
||||
PR_TITLE: 'chore: update EC2 Instance Offerings'
|
||||
|
@ -9,7 +9,7 @@ name: "DataUpdate_EC2InstanceTypes"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '00 12 * * 0'
|
||||
- cron: '00 8 * * 0'
|
||||
|
||||
jobs:
|
||||
update:
|
||||
@ -39,12 +39,11 @@ jobs:
|
||||
- name: Pull EC2 instance types from AWS
|
||||
uses: technote-space/create-pr-action@v2
|
||||
with:
|
||||
# GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
|
||||
EXECUTE_COMMANDS: |
|
||||
pip install boto3
|
||||
scripts/get_instance_info.py
|
||||
COMMIT_MESSAGE: 'chore: update EC2 Instance Types'
|
||||
COMMIT_NAME: 'Moto Admin'
|
||||
COMMIT_EMAIL: 'admin@getmoto.org'
|
||||
PR_BRANCH_NAME: 'chore-update-ec2-types-${PR_ID}'
|
||||
PR_BRANCH_NAME: 'chore-update-ec2-types-${{ github.run_number }}'
|
||||
PR_TITLE: 'chore: update EC2 Instance Types'
|
||||
|
@ -9,8 +9,7 @@ name: "DataUpdate_SSMdefaultAMIs"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '00 12 * * 0'
|
||||
workflow_dispatch:
|
||||
- cron: '00 10 * * 0'
|
||||
|
||||
jobs:
|
||||
update:
|
||||
@ -40,13 +39,12 @@ jobs:
|
||||
- name: Pull SSM default AMIs from AWS
|
||||
uses: technote-space/create-pr-action@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
|
||||
EXECUTE_COMMANDS: |
|
||||
pip install boto3
|
||||
pip install moto
|
||||
pip install moto[all]
|
||||
python scripts/ssm_get_default_amis.py
|
||||
COMMIT_MESSAGE: "chore: update SSM default AMI's"
|
||||
COMMIT_NAME: 'Moto Admin'
|
||||
COMMIT_EMAIL: 'admin@getmoto.org'
|
||||
PR_BRANCH_NAME: 'chore-update-ssm-amis-${PR_ID}'
|
||||
PR_BRANCH_NAME: 'chore-update-ssm-amis-${{ github.run_number }}'
|
||||
PR_TITLE: "chore: update SSM Instance AMI's"
|
||||
|
@ -40,13 +40,12 @@ jobs:
|
||||
- name: Pull SSM default Parameters from AWS
|
||||
uses: technote-space/create-pr-action@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
|
||||
EXECUTE_COMMANDS: |
|
||||
pip install boto3
|
||||
pip install moto
|
||||
pip install moto[all]
|
||||
python scripts/ssm_get_default_params.py
|
||||
COMMIT_MESSAGE: "chore: update SSM default parameters"
|
||||
COMMIT_NAME: 'Moto Admin'
|
||||
COMMIT_EMAIL: 'admin@getmoto.org'
|
||||
PR_BRANCH_NAME: 'chore-update-ssm-params-${PR_ID}'
|
||||
PR_BRANCH_NAME: 'chore-update-ssm-params-${{ github.run_number }}'
|
||||
PR_TITLE: "chore: update SSM Instance parameters"
|
||||
|
@ -85,7 +85,7 @@ def test_import_bad_certificate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ValidationException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ValidationException")
|
||||
raise RuntimeError("Should have raised ValidationException")
|
||||
|
||||
|
||||
@mock_acm
|
||||
@ -132,7 +132,7 @@ def test_get_invalid_certificate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ResourceNotFoundException")
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
|
||||
# Also tests deleting invalid certificate
|
||||
@ -149,7 +149,7 @@ def test_delete_certificate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ResourceNotFoundException")
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
|
||||
@mock_acm
|
||||
@ -252,7 +252,7 @@ def test_add_tags_to_invalid_certificate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ResourceNotFoundException")
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
|
||||
@mock_acm
|
||||
@ -264,7 +264,7 @@ def test_list_tags_for_invalid_certificate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ResourceNotFoundException")
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
|
||||
@mock_acm
|
||||
@ -313,7 +313,7 @@ def test_remove_tags_from_invalid_certificate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ResourceNotFoundException")
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
|
||||
@mock_acm
|
||||
@ -343,7 +343,7 @@ def test_resend_validation_email_invalid():
|
||||
"InvalidDomainValidationOptionsException"
|
||||
)
|
||||
else:
|
||||
raise RuntimeError("Should of raised InvalidDomainValidationOptionsException")
|
||||
raise RuntimeError("Should have raised InvalidDomainValidationOptionsException")
|
||||
|
||||
try:
|
||||
client.resend_validation_email(
|
||||
@ -354,7 +354,7 @@ def test_resend_validation_email_invalid():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ResourceNotFoundException")
|
||||
raise RuntimeError("Should have raised ResourceNotFoundException")
|
||||
|
||||
|
||||
@mock_acm
|
||||
|
@ -55,7 +55,7 @@ def test_delete_dashboard_fail():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("ResourceNotFound")
|
||||
else:
|
||||
raise RuntimeError("Should of raised error")
|
||||
raise RuntimeError("Should have raised error")
|
||||
|
||||
resp = client.list_dashboards()
|
||||
len(resp["DashboardEntries"]).should.equal(3)
|
||||
|
@ -36,7 +36,7 @@ def test_describe_voices():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("400")
|
||||
else:
|
||||
raise RuntimeError("Should of raised an exception")
|
||||
raise RuntimeError("Should have raised an exception")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -71,7 +71,7 @@ def test_put_lexicon_bad_name():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("InvalidParameterValue")
|
||||
else:
|
||||
raise RuntimeError("Should of raised an exception")
|
||||
raise RuntimeError("Should have raised an exception")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -111,7 +111,7 @@ def test_synthesize_speech_bad_lexicon():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("LexiconNotFoundException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised LexiconNotFoundException")
|
||||
raise RuntimeError("Should have raised LexiconNotFoundException")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -131,7 +131,7 @@ def test_synthesize_speech_bad_output_format():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("InvalidParameterValue")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -151,7 +151,7 @@ def test_synthesize_speech_bad_sample_rate():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("InvalidSampleRateException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -171,7 +171,7 @@ def test_synthesize_speech_bad_text_type():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("InvalidParameterValue")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -191,7 +191,7 @@ def test_synthesize_speech_bad_voice_id():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("InvalidParameterValue")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -211,7 +211,7 @@ def test_synthesize_speech_text_too_long():
|
||||
except ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("TextLengthExceededException")
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -234,7 +234,7 @@ def test_synthesize_speech_bad_speech_marks1():
|
||||
"MarksNotSupportedForFormatException"
|
||||
)
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
||||
|
||||
@mock_polly
|
||||
@ -257,4 +257,4 @@ def test_synthesize_speech_bad_speech_marks2():
|
||||
"MarksNotSupportedForFormatException"
|
||||
)
|
||||
else:
|
||||
raise RuntimeError("Should of raised ")
|
||||
raise RuntimeError("Should have raised ")
|
||||
|
@ -56,7 +56,7 @@ def test_create_fifo_queue_fail():
|
||||
except botocore.exceptions.ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("InvalidParameterValue")
|
||||
else:
|
||||
raise RuntimeError("Should of raised InvalidParameterValue Exception")
|
||||
raise RuntimeError("Should have raised InvalidParameterValue Exception")
|
||||
|
||||
|
||||
@mock_sqs
|
||||
@ -96,7 +96,7 @@ def test_create_queue_with_different_attributes_fail():
|
||||
except botocore.exceptions.ClientError as err:
|
||||
err.response["Error"]["Code"].should.equal("QueueAlreadyExists")
|
||||
else:
|
||||
raise RuntimeError("Should of raised QueueAlreadyExists Exception")
|
||||
raise RuntimeError("Should have raised QueueAlreadyExists Exception")
|
||||
|
||||
q_name2 = str(uuid4())[0:6]
|
||||
response = sqs.create_queue(QueueName=q_name2, Attributes={"FifoQueue": "tru"})
|
||||
|
@ -546,7 +546,7 @@ def test_get_nonexistant_parameter():
|
||||
|
||||
try:
|
||||
client.get_parameter(Name="test_noexist", WithDecryption=False)
|
||||
raise RuntimeError("Should of failed")
|
||||
raise RuntimeError("Should have failed")
|
||||
except botocore.exceptions.ClientError as err:
|
||||
err.operation_name.should.equal("GetParameter")
|
||||
err.response["Error"]["Message"].should.equal(
|
||||
|
Loading…
Reference in New Issue
Block a user