Add CloudFormation template to deploy the environment
This commit is contained in:
38
.idea/workspace.xml
generated
38
.idea/workspace.xml
generated
@@ -4,27 +4,23 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="9a6512a2-4a65-46dc-ac79-ea908fa84d1f" name="Changes" comment="">
|
<list default="true" id="9a6512a2-4a65-46dc-ac79-ea908fa84d1f" name="Changes" comment="" />
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/aws.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/weather_forecase.iml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/requirements.txt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/wheaterAPI.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/wheaterAPI.py" afterDir="false" />
|
|
||||||
</list>
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="FileTemplateManagerImpl">
|
||||||
|
<option name="RECENT_TEMPLATES">
|
||||||
|
<list>
|
||||||
|
<option value="Python Script" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
<option name="PREVIOUS_COMMIT_AUTHORS">
|
<option name="PREVIOUS_COMMIT_AUTHORS">
|
||||||
<list>
|
<list>
|
||||||
|
<option value="Jacob Fritsche <jacob@jacob-fritsche.de>" />
|
||||||
<option value="hadoop <hadoop@jacob-fritsche.de>" />
|
<option value="hadoop <hadoop@jacob-fritsche.de>" />
|
||||||
<option value="hadoop@jacob-fritsche.de" />
|
<option value="hadoop@jacob-fritsche.de" />
|
||||||
<option value="Jacob Fritsche" />
|
<option value="Jacob Fritsche" />
|
||||||
@@ -46,7 +42,7 @@
|
|||||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"last_opened_file_path": "C:/Users/jacob/PycharmProjects/GCP-Weather-Forecast",
|
"last_opened_file_path": "C:/Users/jacob/PycharmProjects/AWS Weather Forecast",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
@@ -76,6 +72,7 @@
|
|||||||
<workItem from="1709141002289" duration="33000" />
|
<workItem from="1709141002289" duration="33000" />
|
||||||
<workItem from="1709141085982" duration="184000" />
|
<workItem from="1709141085982" duration="184000" />
|
||||||
<workItem from="1709141371555" duration="1607000" />
|
<workItem from="1709141371555" duration="1607000" />
|
||||||
|
<workItem from="1709143935553" duration="351000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="Initial code to get the weather data from the API">
|
<task id="LOCAL-00001" summary="Initial code to get the weather data from the API">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -101,7 +98,15 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1708267319084</updated>
|
<updated>1708267319084</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="4" />
|
<task id="LOCAL-00004" summary="Add lambda function to write json to dynamo db">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1709144200442</created>
|
||||||
|
<option name="number" value="00004" />
|
||||||
|
<option name="presentableId" value="LOCAL-00004" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1709144200442</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="5" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -121,6 +126,7 @@
|
|||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="Initial code to get the weather data from the API" />
|
<MESSAGE value="Initial code to get the weather data from the API" />
|
||||||
<MESSAGE value="Add requirements.txt to control python package version" />
|
<MESSAGE value="Add requirements.txt to control python package version" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="Add requirements.txt to control python package version" />
|
<MESSAGE value="Add lambda function to write json to dynamo db" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Add lambda function to write json to dynamo db" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
36
src/cloudformation/API_to_DynamoDB.yaml
Normal file
36
src/cloudformation/API_to_DynamoDB.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
AWSTemplateFormatVersion: '2010-09-09'
|
||||||
|
Resources:
|
||||||
|
MyLambdaFunction:
|
||||||
|
Type: 'AWS::Lambda::Function'
|
||||||
|
Properties:
|
||||||
|
Handler: lambda_function.handler
|
||||||
|
Role: arn:aws:iam::123456789012:role/your-execution-role
|
||||||
|
FunctionName: YourLambdaFunction
|
||||||
|
Runtime: python3.8
|
||||||
|
Code:
|
||||||
|
S3Bucket: your-s3-bucket
|
||||||
|
S3Key: your-code-package.zip
|
||||||
|
|
||||||
|
MyApi:
|
||||||
|
Type: 'AWS::ApiGateway::RestApi'
|
||||||
|
Properties:
|
||||||
|
Name: YourAPI
|
||||||
|
|
||||||
|
MyApiResource:
|
||||||
|
Type: 'AWS::ApiGateway::Resource'
|
||||||
|
Properties:
|
||||||
|
ParentId: !GetAtt MyApi.RootResourceId
|
||||||
|
RestApiId: !Ref MyApi
|
||||||
|
PathPart: your-resource
|
||||||
|
|
||||||
|
MyApiMethod:
|
||||||
|
Type: 'AWS::ApiGateway::Method'
|
||||||
|
Properties:
|
||||||
|
AuthorizationType: NONE
|
||||||
|
HttpMethod: POST
|
||||||
|
ResourceId: !Ref MyApiResource
|
||||||
|
RestApiId: !Ref MyApi
|
||||||
|
Integration:
|
||||||
|
IntegrationHttpMethod: POST
|
||||||
|
Type: AWS_PROXY
|
||||||
|
Uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyLambdaFunction.Arn}/invocations
|
||||||
Reference in New Issue
Block a user