Skip to content

Commit

Permalink
added example
Browse files Browse the repository at this point in the history
  • Loading branch information
joshheyse committed Feb 16, 2021
1 parent fe3b349 commit 2600385
Show file tree
Hide file tree
Showing 6 changed files with 5,306 additions and 62 deletions.
1 change: 1 addition & 0 deletions README.md
19 changes: 19 additions & 0 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "example",
"version": "1.0.0",
"description": "> TODO: description",
"author": "Josh Heyse <[email protected]>",
"homepage": "https://github.com/joshheyse/aws-policies/tree/master/packages/example#readme",
"license": "ISC",
"private": true,
"main": "scr/index.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/joshheyse/aws-policies.git"
},
"dependencies": {
"@aws-cdk/aws-iam": "^1.89.0",
"@aws-cdk/aws-s3": "^1.89.0",
"aws-policies": "^1.0.0"
}
}
22 changes: 22 additions & 0 deletions packages/example/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as policies from 'aws-policies';
import * as cdk from '@aws-cdk/core';
import * as iam from '@aws-cdk/aws-iam';
import * as s3 from '@aws-cdk/aws-s3';


export class VpcStack extends cdk.Stack {

constructor(construct: cdk.Construct, id: string, props?: cdk.StackProps) {
super(construct, id, props);

const bucket = new s3.Bucket(this, 'Bucket', {
bucketName: 'MyBucket'
});

bucket.addToResourcePolicy(new iam.PolicyStatement({
actions: [
policies.s3.ListJobs // s3:ListJobs
]
}));
}
}
21 changes: 21 additions & 0 deletions packages/example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./src",
"skipLibCheck": true,
"strict": true,
"target": "es5"
},
"exclude": [
"./generate.ts",
"node_modules"
],
"include": [
"./src"
]
}

2 changes: 1 addition & 1 deletion packages/generator/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "aws_policies",
"name": "generator",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Loading

0 comments on commit 2600385

Please sign in to comment.