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-OC' | |
| Parameters: | |
| instanceArn: | |
| Type: String | |
| principalId: | |
| Type: String | 
  
    
      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
    
  
  
    
  | Parameters: | |
| <<: !Include '../organization-parameters.yml' | |
| appName: | |
| Type: String | |
| Default: 'sso' | |
| # AWS SSO instance ARN | |
| instanceArn: | |
| Type: String | 
  
    
      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
    
  
  
    
  | Parameters: | |
| <<: !Include "../organization-parameters.yml" | |
| catalogBucket: | |
| Type: String | |
| Default: community-resource-provider-catalog | |
| SsoAssignmentGroupRp: | |
| Type: register-type | |
| ResourceType: "Community::SSO::AssignmentGroup" | 
  
    
      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' | |
| Parameters: | |
| budgetName: | |
| Type: String | |
| emailAddress: | |
| Type: String | |
| Default: '' | |
| budgetAmount: | |
| Type: Number | 
  
    
      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
    
  
  
    
  | Parameters: | |
| <<: !Include '../organization-parameters.yml' | |
| BudgetAlarms: | |
| Type: update-stacks | |
| Template: ./budgets.yml | |
| StackName: !Sub '${resourcePrefix}-billing-alarm' | |
| TerminationProtection: false | |
| DefaultOrganizationBinding: | |
| Region: !Ref primaryRegion | 
  
    
      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 * as DynamoDB from 'aws-sdk/clients/dynamodb'; | |
| import {v4 as uuid} from 'uuid'; | |
| const ddb = new DynamoDB.DocumentClient({region: 'us-east-1'}); | |
| const t = (startInMinutes: number) => { | |
| const d = new Date(new Date().getTime() + 1_000 * 60 * startInMinutes); | |
| return { | |
| "pk": `j#${d.getUTCFullYear()}-${d.getUTCMonth()}-${d.getUTCDate()}T${d.getUTCHours()}:${d.getUTCMinutes()}`, | |
| "sk": `${d.toISOString()}#${uuid()}`, | 
  
    
      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
    
  
  
    
  | test | 
  
    
      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
    
  
  
    
  | // file with imports | |
| // old: import { SQS } from "aws-sdk"; | |
| import * as SQS from "aws-sdk/clients/sqs"; | |
| // eslint rule | |
| "rules": { | |
| "no-restricted-imports": ["error", "aws-sdk"] | |
| } | 
  
    
      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
    
  
  
    
  | { | |
| Effect: 'Allow', | |
| Action: ['dynamodb:Query'], | |
| Resource: [ | |
| // assuming a table "EventsTable" with a GSI called "eventIdIndex" | |
| {'Fn::GetAtt': ['EventsTable', 'Arn']}, | |
| {'Fn::Join': [ '/', [{ 'Fn::GetAtt': ['EventsTable', 'Arn' ] }, 'index', 'eventIdIndex' ]]} | |
| ] | |
| } | 
  
    
      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
    
  
  
    
  | def lambda_handler(event, context): | |
| data = event['data'] | |
| print(data) | |
| prices = [] | |
| types = [] | |
| volumes = [] | |
| for page_data in data: | 
NewerOlder