@aws-cdk/aws-events
Version:
Amazon EventBridge Construct Library
654 lines • 519 kB
JSON
{
"version": "2",
"toolVersion": "1.57.0",
"snippets": {
"7cf49f40f663c44c6234d9e5bf65b18c13a6e7329610df601d01a65a8bccd5d7": {
"translations": {
"python": {
"source": "# repo: codecommit.Repository\n# project: codebuild.Project\n\n\non_commit_rule = repo.on_commit(\"OnCommit\",\n target=targets.CodeBuildProject(project),\n branches=[\"master\"]\n)",
"version": "2"
},
"csharp": {
"source": "Repository repo;\nProject project;\n\n\nRule onCommitRule = repo.OnCommit(\"OnCommit\", new OnCommitOptions {\n Target = new CodeBuildProject(project),\n Branches = new [] { \"master\" }\n});",
"version": "1"
},
"java": {
"source": "Repository repo;\nProject project;\n\n\nRule onCommitRule = repo.onCommit(\"OnCommit\", OnCommitOptions.builder()\n .target(new CodeBuildProject(project))\n .branches(List.of(\"master\"))\n .build());",
"version": "1"
},
"go": {
"source": "var repo repository\nvar project project\n\nonCommitRule := repo.onCommit(jsii.String(\"OnCommit\"), &onCommitOptions{\n\ttarget: targets.NewCodeBuildProject(project),\n\tbranches: []*string{\n\t\tjsii.String(\"master\"),\n\t},\n})",
"version": "1"
},
"$": {
"source": "declare const repo: codecommit.Repository;\ndeclare const project: codebuild.Project;\n\nconst onCommitRule = repo.onCommit('OnCommit', {\n target: new targets.CodeBuildProject(project),\n branches: ['master']\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 61
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-codebuild.IProject",
"@aws-cdk/aws-codecommit.OnCommitOptions",
"@aws-cdk/aws-events-targets.CodeBuildProject",
"@aws-cdk/aws-events.IRuleTarget",
"@aws-cdk/aws-events.Rule"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const repo: codecommit.Repository;\ndeclare const project: codebuild.Project;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as ecs from '@aws-cdk/aws-ecs';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst onCommitRule = repo.onCommit('OnCommit', {\n target: new targets.CodeBuildProject(project),\n branches: ['master']\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 2,
"75": 14,
"130": 2,
"153": 2,
"169": 2,
"192": 1,
"193": 1,
"194": 2,
"196": 1,
"197": 1,
"225": 3,
"242": 3,
"243": 3,
"281": 2,
"290": 1
},
"fqnsFingerprint": "17d9c68eb4fac1cbff55367b87d7eb6c7a573c4011e1f272ac93eda10fc8620d"
},
"0ff6e72a22dbd36dacd690373116c162c1bd2b4ff43d7d01218d1ac6811c0ab7": {
"translations": {
"python": {
"source": "# on_commit_rule: events.Rule\n# topic: sns.Topic\n\n\non_commit_rule.add_target(targets.SnsTopic(topic,\n message=events.RuleTargetInput.from_text(f\"A commit was pushed to the repository {codecommit.ReferenceEvent.repositoryName} on branch {codecommit.ReferenceEvent.referenceName}\")\n))",
"version": "2"
},
"csharp": {
"source": "Rule onCommitRule;\nTopic topic;\n\n\nonCommitRule.AddTarget(new SnsTopic(topic, new SnsTopicProps {\n Message = RuleTargetInput.FromText($\"A commit was pushed to the repository {codecommit.ReferenceEvent.repositoryName} on branch {codecommit.ReferenceEvent.referenceName}\")\n}));",
"version": "1"
},
"java": {
"source": "Rule onCommitRule;\nTopic topic;\n\n\nonCommitRule.addTarget(SnsTopic.Builder.create(topic)\n .message(RuleTargetInput.fromText(String.format(\"A commit was pushed to the repository %s on branch %s\", ReferenceEvent.getRepositoryName(), ReferenceEvent.getReferenceName())))\n .build());",
"version": "1"
},
"go": {
"source": "var onCommitRule rule\nvar topic topic\n\nonCommitRule.addTarget(targets.NewSnsTopic(topic, &snsTopicProps{\n\tmessage: events.ruleTargetInput.fromText(\n\tfmt.Sprintf(\"A commit was pushed to the repository %v on branch %v\", codecommit.referenceEvent.repositoryName, codecommit.*referenceEvent.referenceName)),\n}))",
"version": "1"
},
"$": {
"source": "declare const onCommitRule: events.Rule;\ndeclare const topic: sns.Topic;\n\nonCommitRule.addTarget(new targets.SnsTopic(topic, {\n message: events.RuleTargetInput.fromText(\n `A commit was pushed to the repository ${codecommit.ReferenceEvent.repositoryName} on branch ${codecommit.ReferenceEvent.referenceName}`\n )\n}));",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 78
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-events-targets.SnsTopic",
"@aws-cdk/aws-events-targets.SnsTopicProps",
"@aws-cdk/aws-events.IRuleTarget",
"@aws-cdk/aws-events.Rule#addTarget",
"@aws-cdk/aws-events.RuleTargetInput",
"@aws-cdk/aws-events.RuleTargetInput#fromText",
"@aws-cdk/aws-sns.ITopic"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const onCommitRule: events.Rule;\ndeclare const topic: sns.Topic;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as ecs from '@aws-cdk/aws-ecs';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nonCommitRule.addTarget(new targets.SnsTopic(topic, {\n message: events.RuleTargetInput.fromText(\n `A commit was pushed to the repository ${codecommit.ReferenceEvent.repositoryName} on branch ${codecommit.ReferenceEvent.referenceName}`\n )\n}));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"15": 1,
"16": 1,
"17": 1,
"75": 21,
"130": 2,
"153": 2,
"169": 2,
"193": 1,
"194": 8,
"196": 2,
"197": 1,
"211": 1,
"221": 2,
"225": 2,
"226": 1,
"242": 2,
"243": 2,
"281": 1,
"290": 1
},
"fqnsFingerprint": "f145cbc85542cf87295364cac1028907524b57d1a5ffe8cc47bd11ee09edfd08"
},
"8acd9a78f8d185adde2917387febff93e5528fbbc486f4e4718724eadc295dca": {
"translations": {
"python": {
"source": "# on_commit_rule: events.Rule\n# topic: sns.Topic\n\n\non_commit_rule.add_target(targets.SnsTopic(topic,\n message=events.RuleTargetInput.from_object({\n \"DataType\": f\"custom_{events.EventField.fromPath('$.detail-type')}\"\n })\n))",
"version": "2"
},
"csharp": {
"source": "Rule onCommitRule;\nTopic topic;\n\n\nonCommitRule.AddTarget(new SnsTopic(topic, new SnsTopicProps {\n Message = RuleTargetInput.FromObject(new Dictionary<string, string> {\n { \"DataType\", $\"custom_{events.EventField.fromPath('$.detail-type')}\" }\n })\n}));",
"version": "1"
},
"java": {
"source": "Rule onCommitRule;\nTopic topic;\n\n\nonCommitRule.addTarget(SnsTopic.Builder.create(topic)\n .message(RuleTargetInput.fromObject(Map.of(\n \"DataType\", String.format(\"custom_%s\", EventField.fromPath(\"$.detail-type\")))))\n .build());",
"version": "1"
},
"go": {
"source": "var onCommitRule rule\nvar topic topic\n\nonCommitRule.addTarget(targets.NewSnsTopic(topic, &snsTopicProps{\n\tmessage: events.ruleTargetInput.fromObject(map[string]*string{\n\t\t\"DataType\": fmt.Sprintf(\"custom_%v\", events.EventField.fromPath(jsii.String(\"$.detail-type\"))),\n\t}),\n}))",
"version": "1"
},
"$": {
"source": "declare const onCommitRule: events.Rule;\ndeclare const topic: sns.Topic;\n\nonCommitRule.addTarget(new targets.SnsTopic(topic, {\n message: events.RuleTargetInput.fromObject(\n {\n DataType: `custom_${events.EventField.fromPath('$.detail-type')}`\n }\n )\n}));",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 91
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-events-targets.SnsTopic",
"@aws-cdk/aws-events-targets.SnsTopicProps",
"@aws-cdk/aws-events.IRuleTarget",
"@aws-cdk/aws-events.Rule#addTarget",
"@aws-cdk/aws-events.RuleTargetInput",
"@aws-cdk/aws-events.RuleTargetInput#fromObject",
"@aws-cdk/aws-sns.ITopic"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const onCommitRule: events.Rule;\ndeclare const topic: sns.Topic;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as ecs from '@aws-cdk/aws-ecs';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nonCommitRule.addTarget(new targets.SnsTopic(topic, {\n message: events.RuleTargetInput.fromObject(\n {\n DataType: `custom_${events.EventField.fromPath('$.detail-type')}`\n }\n )\n}));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 1,
"15": 1,
"17": 1,
"75": 19,
"130": 2,
"153": 2,
"169": 2,
"193": 2,
"194": 6,
"196": 3,
"197": 1,
"211": 1,
"221": 1,
"225": 2,
"226": 1,
"242": 2,
"243": 2,
"281": 2,
"290": 1
},
"fqnsFingerprint": "1cf19a7a748d1239f6b47dca9cd1884215f3a44d1bb074e996a16d0cb7489b02"
},
"eccf9afcaf8de6691b31152d3661bc14dc7cee02f8010f72354b48b5fa5ed3d8": {
"translations": {
"python": {
"source": "from aws_cdk.aws_events import Rule, Schedule\nfrom aws_cdk.aws_events_targets import EcsTask\nfrom aws_cdk.aws_ecs import Cluster, TaskDefinition\nfrom aws_cdk.aws_iam import Role\n\n# cluster: Cluster\n# task_definition: TaskDefinition\n# role: Role\n\n\necs_task_target = EcsTask(cluster=cluster, task_definition=task_definition, role=role)\n\nRule(self, \"ScheduleRule\",\n schedule=Schedule.cron(minute=\"0\", hour=\"4\"),\n targets=[ecs_task_target]\n)",
"version": "2"
},
"csharp": {
"source": "using Amazon.CDK.AWS.Events;\nusing Amazon.CDK.AWS.Events.Targets;\nusing Amazon.CDK.AWS.ECS;\nusing Amazon.CDK.AWS.IAM;\n\nCluster cluster;\nTaskDefinition taskDefinition;\nRole role;\n\n\nEcsTask ecsTaskTarget = new EcsTask(new EcsTaskProps { Cluster = cluster, TaskDefinition = taskDefinition, Role = role });\n\nnew Rule(this, \"ScheduleRule\", new RuleProps {\n Schedule = Schedule.Cron(new CronOptions { Minute = \"0\", Hour = \"4\" }),\n Targets = new [] { ecsTaskTarget }\n});",
"version": "1"
},
"java": {
"source": "import software.amazon.awscdk.services.events.Rule;\nimport software.amazon.awscdk.services.events.Schedule;\nimport software.amazon.awscdk.services.events.targets.EcsTask;\nimport software.amazon.awscdk.services.ecs.Cluster;\nimport software.amazon.awscdk.services.ecs.TaskDefinition;\nimport software.amazon.awscdk.services.iam.Role;\n\nCluster cluster;\nTaskDefinition taskDefinition;\nRole role;\n\n\nEcsTask ecsTaskTarget = EcsTask.Builder.create().cluster(cluster).taskDefinition(taskDefinition).role(role).build();\n\nRule.Builder.create(this, \"ScheduleRule\")\n .schedule(Schedule.cron(CronOptions.builder().minute(\"0\").hour(\"4\").build()))\n .targets(List.of(ecsTaskTarget))\n .build();",
"version": "1"
},
"go": {
"source": "import awscdkawsevents \"github.com/aws-samples/dummy/awscdkawsevents\"type Rule awscdkawsevents.Rule\ntype Schedule awscdkawsevents.Scheduleimport awscdkawseventstargets \"github.com/aws-samples/dummy/awscdkawseventstargets\"type EcsTask awscdkawseventstargets.EcsTaskimport awscdkawsecs \"github.com/aws-samples/dummy/awscdkawsecs\"type Cluster awscdkawsecs.Cluster\ntype TaskDefinition awscdkawsecs.TaskDefinitionimport awscdkawsiam \"github.com/aws-samples/dummy/awscdkawsiam\"type Role awscdkawsiam.Role\n\nvar cluster cluster\nvar taskDefinition taskDefinition\nvar role role\n\necsTaskTarget := NewEcsTask(&ecsTaskProps{\n\tcluster: cluster,\n\ttaskDefinition: taskDefinition,\n\trole: role,\n})\n\nNewRule(this, jsii.String(\"ScheduleRule\"), &ruleProps{\n\tschedule: schedule.cron(&cronOptions{\n\t\tminute: jsii.String(\"0\"),\n\t\thour: jsii.String(\"4\"),\n\t}),\n\ttargets: []iRuleTarget{\n\t\tecsTaskTarget,\n\t},\n})",
"version": "1"
},
"$": {
"source": "import { Rule, Schedule } from '@aws-cdk/aws-events';\nimport { EcsTask } from '@aws-cdk/aws-events-targets';\nimport { Cluster, TaskDefinition } from '@aws-cdk/aws-ecs';\nimport { Role } from '@aws-cdk/aws-iam';\n\ndeclare const cluster: Cluster;\ndeclare const taskDefinition: TaskDefinition;\ndeclare const role: Role;\n\nconst ecsTaskTarget = new EcsTask({ cluster, taskDefinition, role });\n\nnew Rule(this, 'ScheduleRule', {\n schedule: Schedule.cron({ minute: '0', hour: '4' }),\n targets: [ecsTaskTarget],\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 111
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ecs.ICluster",
"@aws-cdk/aws-ecs.ITaskDefinition",
"@aws-cdk/aws-events-targets.EcsTask",
"@aws-cdk/aws-events-targets.EcsTaskProps",
"@aws-cdk/aws-events.CronOptions",
"@aws-cdk/aws-events.Rule",
"@aws-cdk/aws-events.RuleProps",
"@aws-cdk/aws-events.Schedule",
"@aws-cdk/aws-events.Schedule#cron",
"@aws-cdk/aws-iam.IRole",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\nimport { Rule, Schedule } from '@aws-cdk/aws-events';\nimport { EcsTask } from '@aws-cdk/aws-events-targets';\nimport { Cluster, TaskDefinition } from '@aws-cdk/aws-ecs';\nimport { Role } from '@aws-cdk/aws-iam';\n\ndeclare const cluster: Cluster;\ndeclare const taskDefinition: TaskDefinition;\ndeclare const role: Role;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst ecsTaskTarget = new EcsTask({ cluster, taskDefinition, role });\n\nnew Rule(this, 'ScheduleRule', {\n schedule: Schedule.cron({ minute: '0', hour: '4' }),\n targets: [ecsTaskTarget],\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 7,
"75": 25,
"104": 1,
"130": 3,
"169": 3,
"192": 1,
"193": 3,
"194": 1,
"196": 1,
"197": 2,
"225": 4,
"226": 1,
"242": 4,
"243": 4,
"254": 4,
"255": 4,
"257": 4,
"258": 6,
"281": 4,
"282": 3,
"290": 1
},
"fqnsFingerprint": "d475f9c9575b8eb66617076935580c307d039f547f8303425190b74f03e85bd9"
},
"fc9533bb39108e00dfa980b5b1c40dfe71ad2e992477c5bac2208bf6ca78c9d5": {
"translations": {
"python": {
"source": "# cluster: ecs.Cluster\n# task_definition: ecs.TaskDefinition\n# role: iam.Role\n\n\nplatform_version = ecs.FargatePlatformVersion.VERSION1_4\necs_task_target = targets.EcsTask(cluster=cluster, task_definition=task_definition, role=role, platform_version=platform_version)",
"version": "2"
},
"csharp": {
"source": "Cluster cluster;\nTaskDefinition taskDefinition;\nRole role;\n\n\nFargatePlatformVersion platformVersion = FargatePlatformVersion.VERSION1_4;\nEcsTask ecsTaskTarget = new EcsTask(new EcsTaskProps { Cluster = cluster, TaskDefinition = taskDefinition, Role = role, PlatformVersion = platformVersion });",
"version": "1"
},
"java": {
"source": "Cluster cluster;\nTaskDefinition taskDefinition;\nRole role;\n\n\nFargatePlatformVersion platformVersion = FargatePlatformVersion.VERSION1_4;\nEcsTask ecsTaskTarget = EcsTask.Builder.create().cluster(cluster).taskDefinition(taskDefinition).role(role).platformVersion(platformVersion).build();",
"version": "1"
},
"go": {
"source": "var cluster cluster\nvar taskDefinition taskDefinition\nvar role role\n\nplatformVersion := ecs.fargatePlatformVersion_VERSION1_4\necsTaskTarget := targets.NewEcsTask(&ecsTaskProps{\n\tcluster: cluster,\n\ttaskDefinition: taskDefinition,\n\trole: role,\n\tplatformVersion: platformVersion,\n})",
"version": "1"
},
"$": {
"source": "declare const cluster: ecs.Cluster;\ndeclare const taskDefinition: ecs.TaskDefinition;\ndeclare const role: iam.Role;\n\nconst platformVersion = ecs.FargatePlatformVersion.VERSION1_4;\nconst ecsTaskTarget = new targets.EcsTask({ cluster, taskDefinition, role, platformVersion });",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 131
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ecs.FargatePlatformVersion",
"@aws-cdk/aws-ecs.FargatePlatformVersion#VERSION1_4",
"@aws-cdk/aws-ecs.ICluster",
"@aws-cdk/aws-ecs.ITaskDefinition",
"@aws-cdk/aws-events-targets.EcsTask",
"@aws-cdk/aws-events-targets.EcsTaskProps",
"@aws-cdk/aws-iam.IRole"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const cluster: ecs.Cluster;\ndeclare const taskDefinition: ecs.TaskDefinition;\ndeclare const role: iam.Role;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as ecs from '@aws-cdk/aws-ecs';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst platformVersion = ecs.FargatePlatformVersion.VERSION1_4;\nconst ecsTaskTarget = new targets.EcsTask({ cluster, taskDefinition, role, platformVersion });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"75": 20,
"130": 3,
"153": 3,
"169": 3,
"193": 1,
"194": 3,
"197": 1,
"225": 5,
"242": 5,
"243": 5,
"282": 4,
"290": 1
},
"fqnsFingerprint": "b5f36e86592cf98fd11b0a24c9b4b5f810db015b7b3a187466993616d3f2fec3"
},
"cb3ed42d1e89aa602607c9052cd892132b3e488d3a8a51142ae4d813b3e1bcc7": {
"translations": {
"python": {
"source": "from aws_cdk.core import Environment, Environment\nfrom aws_cdk.core import App, Stack\nimport aws_cdk.aws_codebuild as codebuild\nimport aws_cdk.aws_codecommit as codecommit\nimport aws_cdk.aws_events_targets as targets\n\napp = App()\n\naccount1 = \"11111111111\"\naccount2 = \"22222222222\"\n\nstack1 = Stack(app, \"Stack1\", env=Environment(account=account1, region=\"us-west-1\"))\nrepo = codecommit.Repository(stack1, \"Repository\",\n repository_name=\"myrepository\"\n)\n\nstack2 = Stack(app, \"Stack2\", env=Environment(account=account2, region=\"us-east-1\"))\nproject = codebuild.Project(stack2, \"Project\")\n\nrepo.on_commit(\"OnCommit\",\n target=targets.CodeBuildProject(project)\n)",
"version": "2"
},
"csharp": {
"source": "using Amazon.CDK;\nusing Amazon.CDK.AWS.CodeBuild;\nusing Amazon.CDK.AWS.CodeCommit;\nusing Amazon.CDK.AWS.Events.Targets;\n\nApp app = new App();\n\nstring account1 = \"11111111111\";\nstring account2 = \"22222222222\";\n\nStack stack1 = new Stack(app, \"Stack1\", new StackProps { Env = new Environment { Account = account1, Region = \"us-west-1\" } });\nRepository repo = new Repository(stack1, \"Repository\", new RepositoryProps {\n RepositoryName = \"myrepository\"\n});\n\nStack stack2 = new Stack(app, \"Stack2\", new StackProps { Env = new Environment { Account = account2, Region = \"us-east-1\" } });\nProject project = new Project(stack2, \"Project\", new ProjectProps { });\n\nrepo.OnCommit(\"OnCommit\", new OnCommitOptions {\n Target = new CodeBuildProject(project)\n});",
"version": "1"
},
"java": {
"source": "import software.amazon.awscdk.core.App;\nimport software.amazon.awscdk.core.Stack;\nimport software.amazon.awscdk.services.codebuild.*;\nimport software.amazon.awscdk.services.codecommit.*;\nimport software.amazon.awscdk.services.events.targets.*;\n\nApp app = new App();\n\nString account1 = \"11111111111\";\nString account2 = \"22222222222\";\n\nStack stack1 = Stack.Builder.create(app, \"Stack1\").env(Environment.builder().account(account1).region(\"us-west-1\").build()).build();\nRepository repo = Repository.Builder.create(stack1, \"Repository\")\n .repositoryName(\"myrepository\")\n .build();\n\nStack stack2 = Stack.Builder.create(app, \"Stack2\").env(Environment.builder().account(account2).region(\"us-east-1\").build()).build();\nProject project = Project.Builder.create(stack2, \"Project\").build();\n\nrepo.onCommit(\"OnCommit\", OnCommitOptions.builder()\n .target(new CodeBuildProject(project))\n .build());",
"version": "1"
},
"go": {
"source": "import awscdkcore \"github.com/aws-samples/dummy/awscdkcore\"type App awscdkcore.App\ntype Stack awscdkcore.Stackimport codebuild \"github.com/aws-samples/dummy/awscdkawscodebuild\"import codecommit \"github.com/aws-samples/dummy/awscdkawscodecommit\"import targets \"github.com/aws-samples/dummy/awscdkawseventstargets\"\n\napp := NewApp()\n\naccount1 := \"11111111111\"\naccount2 := \"22222222222\"\n\nstack1 := NewStack(app, jsii.String(\"Stack1\"), &stackProps{\n\tenv: &environment{\n\t\taccount: account1,\n\t\tregion: jsii.String(\"us-west-1\"),\n\t},\n})\nrepo := codecommit.NewRepository(stack1, jsii.String(\"Repository\"), &repositoryProps{\n\trepositoryName: jsii.String(\"myrepository\"),\n})\n\nstack2 := NewStack(app, jsii.String(\"Stack2\"), &stackProps{\n\tenv: &environment{\n\t\taccount: account2,\n\t\tregion: jsii.String(\"us-east-1\"),\n\t},\n})\nproject := codebuild.NewProject(stack2, jsii.String(\"Project\"), &projectProps{\n})\n\nrepo.onCommit(jsii.String(\"OnCommit\"), &onCommitOptions{\n\ttarget: targets.NewCodeBuildProject(project),\n})",
"version": "1"
},
"$": {
"source": "import { App, Stack } from '@aws-cdk/core';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as targets from '@aws-cdk/aws-events-targets';\n\nconst app = new App();\n\nconst account1 = '11111111111';\nconst account2 = '22222222222';\n\nconst stack1 = new Stack(app, 'Stack1', { env: { account: account1, region: 'us-west-1' } });\nconst repo = new codecommit.Repository(stack1, 'Repository', {\n repositoryName: 'myrepository',\n});\n\nconst stack2 = new Stack(app, 'Stack2', { env: { account: account2, region: 'us-east-1' } });\nconst project = new codebuild.Project(stack2, 'Project', {\n // ...\n});\n\nrepo.onCommit('OnCommit', {\n target: new targets.CodeBuildProject(project),\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 163
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-codebuild.IProject",
"@aws-cdk/aws-codebuild.Project",
"@aws-cdk/aws-codebuild.ProjectProps",
"@aws-cdk/aws-codecommit.OnCommitOptions",
"@aws-cdk/aws-codecommit.Repository",
"@aws-cdk/aws-codecommit.RepositoryProps",
"@aws-cdk/aws-events-targets.CodeBuildProject",
"@aws-cdk/aws-events.IRuleTarget",
"@aws-cdk/core.App",
"@aws-cdk/core.Environment",
"@aws-cdk/core.Stack",
"@aws-cdk/core.StackProps",
"constructs.Construct"
],
"fullSource": "import { App, Stack } from '@aws-cdk/core';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as targets from '@aws-cdk/aws-events-targets';\n\nconst app = new App();\n\nconst account1 = '11111111111';\nconst account2 = '22222222222';\n\nconst stack1 = new Stack(app, 'Stack1', { env: { account: account1, region: 'us-west-1' } });\nconst repo = new codecommit.Repository(stack1, 'Repository', {\n repositoryName: 'myrepository',\n});\n\nconst stack2 = new Stack(app, 'Stack2', { env: { account: account2, region: 'us-east-1' } });\nconst project = new codebuild.Project(stack2, 'Project', {\n // ...\n});\n\nrepo.onCommit('OnCommit', {\n target: new targets.CodeBuildProject(project),\n});",
"syntaxKindCounter": {
"10": 14,
"75": 38,
"193": 7,
"194": 4,
"196": 1,
"197": 6,
"225": 7,
"226": 1,
"242": 7,
"243": 7,
"254": 4,
"255": 4,
"256": 3,
"257": 1,
"258": 2,
"281": 8,
"290": 1
},
"fqnsFingerprint": "601170eb478d69cbb6fd1e1ef2a27a061091c3c48d95368858a17b59f2ad584b"
},
"9b906e679698ac5a36a82dbffb362b7397ae5c64753e3a4b41310b70c1be19a7": {
"translations": {
"python": {
"source": "bus = events.EventBus(self, \"bus\",\n event_bus_name=\"MyCustomEventBus\"\n)\n\nbus.archive(\"MyArchive\",\n archive_name=\"MyCustomEventBusArchive\",\n description=\"MyCustomerEventBus Archive\",\n event_pattern=events.EventPattern(\n account=[Stack.of(self).account]\n ),\n retention=Duration.days(365)\n)",
"version": "2"
},
"csharp": {
"source": "EventBus bus = new EventBus(this, \"bus\", new EventBusProps {\n EventBusName = \"MyCustomEventBus\"\n});\n\nbus.Archive(\"MyArchive\", new BaseArchiveProps {\n ArchiveName = \"MyCustomEventBusArchive\",\n Description = \"MyCustomerEventBus Archive\",\n EventPattern = new EventPattern {\n Account = new [] { Stack.Of(this).Account }\n },\n Retention = Duration.Days(365)\n});",
"version": "1"
},
"java": {
"source": "EventBus bus = EventBus.Builder.create(this, \"bus\")\n .eventBusName(\"MyCustomEventBus\")\n .build();\n\nbus.archive(\"MyArchive\", BaseArchiveProps.builder()\n .archiveName(\"MyCustomEventBusArchive\")\n .description(\"MyCustomerEventBus Archive\")\n .eventPattern(EventPattern.builder()\n .account(List.of(Stack.of(this).getAccount()))\n .build())\n .retention(Duration.days(365))\n .build());",
"version": "1"
},
"go": {
"source": "bus := events.NewEventBus(this, jsii.String(\"bus\"), &eventBusProps{\n\teventBusName: jsii.String(\"MyCustomEventBus\"),\n})\n\nbus.archive(jsii.String(\"MyArchive\"), &baseArchiveProps{\n\tarchiveName: jsii.String(\"MyCustomEventBusArchive\"),\n\tdescription: jsii.String(\"MyCustomerEventBus Archive\"),\n\teventPattern: &eventPattern{\n\t\taccount: []*string{\n\t\t\t*stack.of(this).account,\n\t\t},\n\t},\n\tretention: duration.days(jsii.Number(365)),\n})",
"version": "1"
},
"$": {
"source": "const bus = new events.EventBus(this, 'bus', {\n eventBusName: 'MyCustomEventBus'\n});\n\nbus.archive('MyArchive', {\n archiveName: 'MyCustomEventBusArchive',\n description: 'MyCustomerEventBus Archive',\n eventPattern: {\n account: [Stack.of(this).account],\n },\n retention: Duration.days(365),\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 204
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-events.BaseArchiveProps",
"@aws-cdk/aws-events.EventBus",
"@aws-cdk/aws-events.EventBusProps",
"@aws-cdk/aws-events.EventPattern",
"@aws-cdk/core.Duration",
"@aws-cdk/core.Duration#days",
"@aws-cdk/core.Stack#account",
"@aws-cdk/core.Stack#of",
"constructs.Construct",
"constructs.IConstruct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as ecs from '@aws-cdk/aws-ecs';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst bus = new events.EventBus(this, 'bus', {\n eventBusName: 'MyCustomEventBus'\n});\n\nbus.archive('MyArchive', {\n archiveName: 'MyCustomEventBusArchive',\n description: 'MyCustomerEventBus Archive',\n eventPattern: {\n account: [Stack.of(this).account],\n },\n retention: Duration.days(365),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"8": 1,
"10": 5,
"75": 16,
"104": 2,
"192": 1,
"193": 3,
"194": 5,
"196": 3,
"197": 1,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 6
},
"fqnsFingerprint": "8a370448c8850f9d3bf4b97e19e578ded327b3a3770acbff3aee6834ce814a3f"
},
"8b5cf83c5bb4b90175ce2c38aaa59de642928ef4d0c277ccebc7f0e17d8196fa": {
"translations": {
"python": {
"source": "# lambda_function: lambda.Function\n\n\nevent_bus = events.EventBus.from_event_bus_arn(self, \"ImportedEventBus\", \"arn:aws:events:us-east-1:111111111:event-bus/my-event-bus\")\n\n# now you can just call methods on the eventbus\nevent_bus.grant_put_events_to(lambda_function)",
"version": "2"
},
"csharp": {
"source": "Function lambdaFunction;\n\n\nIEventBus eventBus = EventBus.FromEventBusArn(this, \"ImportedEventBus\", \"arn:aws:events:us-east-1:111111111:event-bus/my-event-bus\");\n\n// now you can just call methods on the eventbus\neventBus.GrantPutEventsTo(lambdaFunction);",
"version": "1"
},
"java": {
"source": "Function lambdaFunction;\n\n\nIEventBus eventBus = EventBus.fromEventBusArn(this, \"ImportedEventBus\", \"arn:aws:events:us-east-1:111111111:event-bus/my-event-bus\");\n\n// now you can just call methods on the eventbus\neventBus.grantPutEventsTo(lambdaFunction);",
"version": "1"
},
"go": {
"source": "var lambdaFunction function\n\neventBus := events.eventBus.fromEventBusArn(this, jsii.String(\"ImportedEventBus\"), jsii.String(\"arn:aws:events:us-east-1:111111111:event-bus/my-event-bus\"))\n\n// now you can just call methods on the eventbus\neventBus.grantPutEventsTo(lambdaFunction)",
"version": "1"
},
"$": {
"source": "declare const lambdaFunction: lambda.Function;\n\nconst eventBus = events.EventBus.fromEventBusArn(this, 'ImportedEventBus', 'arn:aws:events:us-east-1:111111111:event-bus/my-event-bus');\n\n// now you can just call methods on the eventbus\neventBus.grantPutEventsTo(lambdaFunction);",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-events"
},
"field": {
"field": "markdown",
"line": 226
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-events.EventBus",
"@aws-cdk/aws-events.EventBus#fromEventBusArn",
"@aws-cdk/aws-events.IEventBus",
"@aws-cdk/aws-events.IEventBus#grantPutEventsTo",
"@aws-cdk/aws-iam.IGrantable",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const lambdaFunction: lambda.Function;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Stack, Duration } from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as codecommit from '@aws-cdk/aws-codecommit';\nimport * as codebuild from '@aws-cdk/aws-codebuild';\nimport * as sns from '@aws-cdk/aws-sns';\nimport * as ecs from '@aws-cdk/aws-ecs';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as lambda from '@aws-cdk/aws-lambda';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst eventBus = events.EventBus.fromEventBusArn(this, 'ImportedEventBus', 'arn:aws:events:us-east-1:111111111:event-bus/my-event-bus');\n\n// now you can just call methods on the eventbus\neventBus.grantPutEventsTo(lambdaFunction);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 2,
"75": 10,
"104": 1,
"130": 1,
"153": 1,
"169": 1,
"194": 3,
"196": 2,
"225": 2,
"226": 1,
"242": 2,
"243": 2,
"290": 1
},
"fqnsFingerprint": "cc068bc2c924b1e141e3c013b86be098f8cac5d226af8bee597d203bbf2dbea1"
},
"a4827dbeee1582d0bb87d1ecadcb5b55214df35b9893403fde11829245c840cb": {
"translations": {
"python": {
"source": "connection = events.Connection(self, \"Connection\",\n authorization=events.Authorization.api_key(\"x-api-key\", SecretValue.secrets_manager(\"ApiSecretName\")),\n description=\"Connection with API Key x-api-key\"\n)\n\ndestination = events.ApiDestination(self, \"Destination\",\n connection=connection,\n endpoint=\"https://example.com\",\n description=\"Calling example.com with API key x-api-key\"\n)\n\nrule = events.Rule(self, \"Rule\",\n schedule=events.Schedule.rate(cdk.Duration.minutes(1)),\n targets=[targets.ApiDestination(destination)]\n)",
"version": "2"
},
"csharp": {
"source": "Connection connection = new Connection(this, \"Connection\", new ConnectionProps {\n Authorization = Authorization.ApiKey(\"x-api-key\", SecretValue.SecretsManager(\"ApiSecretName\")),\n Description = \"Connection with API Key x-api-key\"\n});\n\nApiDestination destination = new ApiDestination(this, \"Destination\", new ApiDestinationProps {\n Connection = connection,\n Endpoint = \"https://example.com\",\n Description = \"Calling example.com with API key x-api-key\"\n});\n\nRule rule = new Rule(this, \"Rule\", new RuleProps {\n Schedule = Schedule.Rate(Duration.Minutes(1)),\n Targets = new [] { new ApiDestination(destination) }\n});",
"version": "1"
},
"java": {
"source": "Connection connection = Connection.Builder.create(this, \"Connection\")\n .authorization(Authorization.apiKey(\"x-api-key\", SecretValue.secretsManager(\"ApiSecretName\")))\n .description(\"Connection with API Key x-api-key\")\n .build();\n\nApiDestination destination = ApiDestination.Builder.create(this, \"Destination\")\n .connection(connection)\n .endpoint(\"https://example.com\")\n .description(\"Calling example.com with API key x-api-key\")\n .build();\n\nRule rule = Rule.Builder.create(this, \"Rule\")\n .schedule(Schedule.rate(Duration.minutes(1)))\n .targets(List.of(new ApiDestination(destination)))\n .build();",
"version": "1"
},
"go": {
"source": "connection := events.NewConnection(this, jsii.String(\"Connection\"), &connectionProps{\n\tauthorization: events.authorization.apiKey(jsii.String(\"x-api-key\"), secretValue.secretsManager(jsii.String(\"ApiSecretName\"))),\n\tdescription: jsii.String(\"Connection with API Key x-api-key\"),\n})\n\ndestination := events.NewApiDestination(this, jsii.String(\"Destination\"), &apiDestinationProps{\n\tconnection: connection,\n\tendpoint: jsii.String(\"https://example.com\"),\n\tdescription: jsii.String(\"Calling example.com with API key x-api-key\"),\n})\n\nrule := events.NewRule(this, jsii.String(\"Rule\"), &ruleProps{\n\tschedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),\n\ttargets: []iRuleTarget{\n\t\ttargets.NewApiDestination(destination),\n\t},\n})",
"version": "1"
},
"$": {
"source": "const connection = new events.Connection(this, 'Connection', {\n authorization: events.Authorization.apiKey('x-api-key', SecretValue.secretsManager('ApiSecretName')),\n description: 'Connection with API Key x-api-key',\n});\n\nconst destination = new events.ApiDestination(this, 'Destination', {\n connection,\n endpoint: 'https://example.com',\n description: 'Calling example.com with API key x-api-key',\n});\n\nconst rule = new events.Rule(this, 'Rule', {\n schedule: events.Schedule.rate(cdk.Duration.minutes(1)),\n targets: [new targets.ApiDestination(destination)],\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "type",
"fqn": "@aws-cdk/aws-events.ApiDestination"
},
"field": {
"field": "example"
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-events-targets.ApiDestination",
"@aws-cdk/aws-events.ApiDestination",
"@aws-cdk/aws-events.ApiDestinationProps",
"@aws-cdk/aws-events.Authorization",
"@aws-cdk/aws-events.Authorization#apiKey",
"@aws-cdk/aws-events.Connection",
"@aws-cdk/aws-events.ConnectionProps",
"@aws-cdk/aws-events.IApiDestination",
"@aws-cdk/aws-events.IConnection",
"@aws-cdk/aws-events.Rule",
"@aws-cdk/aws-events.RuleProps",
"@aws-cdk/aws-events.Schedule",
"@aws-cdk/aws-events.Schedule#rate",
"@aws-cdk/core.Duration",
"@aws-cdk/core.Duration#minutes",
"@aws-cdk/core.SecretValue",
"@aws-cdk/core.SecretValue#secretsManager",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Duration, RemovalPolicy, SecretValue, Stack } from '@aws-cdk/core';\nimport { Construct } from 'constructs';\n\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as events from '@aws-cdk/aws-events';\nimport * as sqs from '@aws-cdk/aws-sqs';\nimport * as cdk from '@aws-cdk/core';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst connection = new events.Connection(this, 'Connection', {\n authorization: events.Authorization.apiKey('x-api-key', SecretValue.secretsManager('ApiSecretName')),\n description: 'Connection with API Key x-api-key',\n});\n\nconst destination = new events.ApiDestination(this, 'Destination', {\n connection,\n endpoint: 'https://example.com',\n description: 'Calling example.com with API key x-api-key',\n});\n\nconst rule = new events.Rule(this, 'Rule', {\n schedule: events.Schedule.rate(cdk.Duration.minutes(1)),\n targets: [new targets.ApiDestination(destination)],\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 1,
"10": 8,
"75": 30,
"104": 3,
"192": 1,
"193": 3,
"194": 11,
"196": 4,
"197": 4,
"225": 3,
"242": 3,
"243": 3,
"281": 6,
"282": 1
},
"fqnsFingerprint": "d2c56457bed24a5a332230dfd2303263bf2a0e23e167544d086fc2ba69a24328"
},
"c8275deddeed5cd49edb8c21a818c2b3d1bd40389befb97dd8166e2ccb80f9f4": {
"translations": {
"python": {
"source": "connection = events.Connection(self, \"Connection\",\n authorization=events.Authorization.api_key(\"x-api-key\", SecretValue.secrets_manager(\"ApiSecretName\")),\n description=\"Connection with API Key x-api-key\"\n)\n\ndestination = events.ApiDestination(self, \"Destination\",\n connection=connection,\n endpoint=\"https://example.com\",\n description=\"Calling example.com with API key x-api-key\"\n)\n\nrule = events.Rule(self, \"Rule\",\n schedule=events.Schedule.rate(cdk.Duration.minutes(1)),\n targets=[targets.ApiDestination(destination)]\n)",
"version": "2"
},
"csharp": {
"source": "Connection connection = new Connection(this, \"Connection\", new ConnectionProps {\n Authorization = Authorization.ApiKey(\"x-api-key\", SecretValue.SecretsManager(\"ApiSecretName\")),\n Description = \"Connection with API Key x-api-key\"\n});\n\nApiDestination destination = new ApiDestination(this, \"Destination\", new ApiDestinationProps {\n Connection = connection,\n Endpoint = \"https://example.com\",\n Description = \"Calling example.com with API key x-api-key\"\n});\n\nRule rule = new Rule(this, \"Rule\", new RuleProps {\n Schedule = Schedule.Rate(Duration.Minutes(1)),\n Targets = new [] { new ApiDestination(destination) }\n});",
"version": "1"
},
"java": {
"source": "Connection connection = Connection.Builder.create(this, \"Connection\")\n .authorization(Authorization.apiKey(\"x-api-key\", SecretValue.secretsManager(\"ApiSecretName\")))\n .description(\"Connection with API Key x-api-key\")\n .build();\n\nApiDestination destination = ApiDestination.Builder.create(this, \"Destination\")\n .connection(connection)\n .endpoint(\"https://example.com\")\n .description(\"Calling example.com with API key x-api-key\")\n .build();\n\nRule rule = Rule.Builder.create(this, \"Rule\")\n .schedule(Schedule.rate(Duration.minutes(1)))\n .targets(List.of(new ApiDestination(destination)))\n .build();",
"version": "1"
},
"go": {
"source": "connection := events.NewConnection(this, jsii.String(\"Connection\"), &connectionProps{\n\tauthorization: events.authorization.apiKey(jsii.String(\"x-api-key\"), secretValue.secretsManager(jsii.String(\"ApiSecretName\"))),\n\tdescription: jsii.String(\"Connection with API Key x-api-key\"),\n})\n\ndestination := events.NewApiDestination(this, jsii.String(\"Destination\"), &apiDestinationProps{\n\tconnection: connection,\n\tendpoint: jsii.String(\"https://example.com\"),\n\tdescription: jsii.String(\"Calling example.com with API key x-api-key\"),\n})\n\nrule := events.NewRule(this, jsii.String(\"Rule\"), &ruleProps{\n\tschedule: events.schedule.rate(cdk.duration.minutes(jsii.Number(1))),\n\ttargets: []iRuleTarget{\n\t\ttargets.NewApiDestination(destination),\n\t},\n})",
"version": "1"
},
"$": {
"source": "const connection = new events.Connection(this, 'Connection', {\n authorization: events.Authorization.apiKey('x-api-key', SecretValue.secretsManager('ApiSecretName')),\n description: 'Connection with API Key x-api-key',\n});\n\nconst destination = new events.ApiDestination(this, 'Destination', {\n connection,\n endpoint: 'https://example.com',\n description: 'Calling example.com with API key x-api-key',\n});\n\nconst rule = new events.Rule(this, 'Rule', {\n schedule: events.Schedule.rate(cdk.Duration.minutes(1)),\n targets: [new targets.ApiDestination(destination)],\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "type",
"fqn": "@aws-cdk/aws-events.ApiDestinationProps"
},
"field": {
"field": "example"
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-events-targets.ApiDestination",
"@aws-cdk/aws-events.ApiDestination",
"@aws-cdk/aws-events.ApiDestinationProps",
"@aws-cdk/aws-events.Authorization",
"@aws-cdk/aws-events.Authorization#apiKey",
"@aws-cdk/aws-events.Connection",
"@aws-cdk/aws-events.ConnectionProps",
"@aws-cdk/aws-events.IApiDestination",
"@aws-cdk/aws-events.IConnection",
"@aws-cdk/aws-events.Rule",
"@aws-cdk/aws-events.RuleProps",
"@aws-cdk/aws-events.Schedule",
"@aws-cdk/aws-events.Schedule#rate",
"@aws-cdk/core.Duration",
"@aws-cdk/core.Duration#minutes",
"@aws-cdk/core.SecretValue",
"@aws-cdk/core.SecretValue#secretsManager",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Duration, RemovalPolicy, SecretValue, Stack } from '@aws-cdk/core';\nimport { Construct } from 'constructs';\n\nimport * as targets from '@aws-cdk/aws-events-targets';\nimport * as events from '@aws-cdk/aws-events';\nimport * as sqs from '@aws-cdk/aws-sqs';\nimport * as cdk from '@aws-cdk/core';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst connection = new events.Connection(this, 'Connection', {\n authorization: events.Authorization.apiKey('x-api-key', SecretValue.secretsManager('ApiSecretName')),\n description: 'Connection with API Key x-api-key',\n});\n\nconst destination = new events.ApiDestination(this, 'Destination', {\n connection,\n endpoint: 'https://example.com',\n description: 'Calling example.com with API key x-api-key',\n});\n\nconst rule = new events.Rule(this, 'Rule', {\n schedule: events.Schedule.rate(cdk.Duration.minutes(1)),\n targets: [new targets.ApiDestination(destination)],\n});\n/// !hide\n// Code snippet ended before !h