Comments (6)
Yeah, that's actually a good idea. Could do the same for function configuration. Then, if we can eliminate the need for caching the zip file checksum locally we could eliminate the local cache completely which would be a very good thing.
from kappa.
So, maybe I'm missing it but is there an IAM API request that will return the policy document associated with a Managed Policy or a version of a Managed Policy?
from kappa.
It's GetPolicy, the arn is like "arn:aws:iam::aws:policy/AWSLambdaFullAccess"
from kappa.
It's actually GetPolicyVersion, I think. It doesn't preserve the original form so you have to do a more intelligent diff then just doing a string compare.
from kappa.
Ah I see, I didn't look hard enough (i.e. at all) at the output of aws-cli, just that it completed without errors.
from kappa.
The following is POC code to get the current policy document. You'll still need to compare each statement, but that should be relatively easy?
import boto3
client = boto3.client('iam')
policy_arn = 'arn:aws:iam::093535234988:policy/kappa/{0}_{1}'.format(app_name, app_env)
response = client.get_policy(
PolicyArn=policy_arn
)
version_id = response.get('Policy', {}).get('DefaultVersionId', None)
if version_id is None:
raise Exception('Failed to get policy')
response = client.get_policy_version(
PolicyArn=policy_arn,
VersionId=version_id
)
document = response.get('PolicyVersion', {}).get('Document', None)
if document is None:
raise Exception('Failed to get current policy document')
# compare the version here
No idea what the policy is around error handling, so feel free to substitute that here.
from kappa.
Related Issues (20)
- UnboundLocalError: local variable 'version' referenced before assignment HOT 2
- kappa deletes the manually created env vars HOT 2
- s3transfer not excluded in zip file, causing compatibility issues HOT 1
- Support Remote Environment Variables
- MalformedPolicyDocumentException: An error occurred when calling the CreatePolicy operation: Actions/Condition can contain only one colon. HOT 2
- Why do region and profile need to be defined? Why can't it find and use default region and profile? HOT 2
- Unable to update alias HOT 10
- DescribeSecurityGroups not useable HOT 1
- Working example using Java
- Please release a new Kappa version HOT 1
- Kinesis Event Source add function not working as expected HOT 1
- nodejs function deployment hangs HOT 1
- Installation fails on python 3.5 amazon-linux docker HOT 2
- Cannot have multiple S3 event sources on same bucket for same Lambda Function. HOT 1
- Update code without configuration update
- UnicodeDecodeError when installed as dependency of Zappa HOT 3
- Cannot use different VPC config for different environments
- hi, is any maintainer active? HOT 1
- Issue with setup.py
- SyntaxWarning over comparison of literals using is
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kappa.