This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: > | |
| shortenLink | |
| Sample SAM Template for shortenLink | |
| Globals: | |
| Function: | |
| Timeout: 3 | |
| Runtime: python3.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ProductS3: | |
| Type: AWS::S3::Bucket | |
| Properties: | |
| AccelerateConfiguration: | |
| AccelerationStatus: Enabled | |
| BucketName: !Join [ "-" , ["product-bucket", !Ref BRANCH]] | |
| CorsConfiguration: | |
| CorsRules: | |
| - AllowedMethods: | |
| - GET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| from botocore.exceptions import ClientError | |
| bucket='filtered-df-sagemaker' | |
| s3 = boto3.client('s3') | |
| try: | |
| s3.create_bucket( | |
| Bucket=bucket, | |
| CreateBucketConfiguration={'LocationConstraint':'ap-southeast-1'}) | |
| except ClientError as e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Cognito Stack | |
| Parameters: | |
| AuthName: | |
| Type: String | |
| Description: Unique Auth Name for Cognito Resources | |
| Resources: | |
| # Creates a role that allows Cognito to send SNS messages | |
| SNSRole: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://www.vembu.com/blog/increase-swap-memory-centos-7/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: > | |
| shortenLink | |
| Sample SAM Template for shortenLink | |
| Globals: | |
| Function: | |
| Timeout: 3 | |
| Runtime: python3.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import json | |
| df = pd.DataFrame({'hello':['1','2','2'], 'world':['1','2','3']}) | |
| df | |
| tableDict = df.to_dict(orient='list') | |
| json.dumps(tableDict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dataclasses import dataclass | |
| from dataclasses_json import dataclass_json, Undefined | |
| from dataclasses_json.undefined import UndefinedParameterError | |
| from dataclasses_jsonschema import JsonSchemaMixin | |
| from typing import Optional | |
| @dataclass_json(undefined=Undefined.RAISE) | |
| @dataclass | |
| class Info(JsonSchemaMixin): | |
| conf_one: float |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Resources: | |
| Type: AWS::Serverless::Function | |
| Properties: | |
| Events: | |
| RunHourly: | |
| Type: Schedule | |
| Properties: | |
| Schedule: rate(10 minutes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: CORS example | |
| Resources: | |
| S3Bucket: | |
| Type: "AWS::S3::Bucket" | |
| Properties: | |
| CorsConfiguration: | |
| CorsRules: |