Comments (8)
Sorry for my late replies.
I fixed the panic in https://github.com/jckuester/awsweeper/releases/tag/v0.10.0. Can you try if the new version makes any difference?
For the offline mode, I first have to make some changes, so that this can work. I'll let you know when I am done and give you a more detailed instruction.
Unfortunately, I didn't find time yet to start a lambda myself and reconstruct the problem.
from awsweeper.
Hi @showerlee,
-
the nil pointer panic (
panic: can't use ElementIterator on null value
) is definitely a bug, which I need to fix. -
can you run awsweeper with
-debug
flag, so that we can see more infos? -
How are you downloading the
awsweeper
binary into the lambda? From an S3 bucket? An option would be to also pre-download the extra binary that awsweeper needs (https://releases.hashicorp.com/terraform-provider-aws/2.59.0/) and then you wouldn't need the NAT gatway. I would need to fix something first for this "offline" mode, though. -
I will investigate myself if it is problem running awsweeper in a lambda in another region. If so, it shouldn't be this way.
Cheers.
Jan
from awsweeper.
Hi @jckuester ,
-
the nil pointer panic (panic: can't use ElementIterator on null value) is definitely a bug, which I need to fix.
Thanks for identifying this is a bug. -
can you run awsweeper with -debug flag, so that we can see more infos?
Here is the output for debug mode.
2020-06-07T17:02:00.673+08:00 | START RequestId: e1dcc93a-b710-4c66-8ac2-edae677987d9 Version: $LATEST
-- | --
| 2020-06-07T17:02:12.540+08:00 | • downloaded and installed provider name=aws version=2.59.0
| 2020-06-07T17:02:16.811+08:00 | • configured provider name=aws version=2.59.0
| 2020-06-07T17:02:16.905+08:00 | • SHOWING RESOURCES THAT WOULD BE DELETED (DRY RUN)
| 2020-06-07T17:02:17.449+08:00 | • failed to import resource; trying to read resource without import error=error reading ECS Cluster (arn:aws:ecs:ap-northeast-1:494xxxxxxxx5:cluster/arn:aws:ecs:ap-northeast-1:494xxxxxxxxx5:cluster/bayer-demo): InvalidParameterException: Unsupported resource type: cluster id=arn:aws:ecs:ap-northeast-1:494xxxxxxxx95:cluster/bayer-demo type=aws_ecs_cluster
| 2020-06-07T17:02:19.225+08:00 | panic: can't use ElementIterator on null value
| 2020-06-07T17:02:19.225+08:00 | goroutine 1 [running]:
| 2020-06-07T17:02:19.225+08:00 | github.com/zclconf/go-cty/cty.Value.ElementIterator(0x6378ba0, 0xc000564488, 0x0, 0x0, 0x10, 0x2)
| 2020-06-07T17:02:19.225+08:00 | /home/jan/go/pkg/mod/github.com/zclconf/[email protected]/cty/value_ops.go:1038 +0x101
| 2020-06-07T17:02:19.225+08:00 | github.com/zclconf/go-cty/cty.Value.AsValueMap(0x6378ba0, 0xc000564488, 0x0, 0x0, 0x1)
| 2020-06-07T17:02:19.225+08:00 | /home/jan/go/pkg/mod/github.com/zclconf/[email protected]/cty/value_ops.go:1243 +0xe5
| 2020-06-07T17:02:19.225+08:00 | github.com/cloudetc/awsweeper/pkg/resource.GetTags(0xc000239770, 0xb, 0xb, 0x0)
| 2020-06-07T17:02:19.225+08:00 | /home/jan/git/github.com/cloudetc/awsweeper/pkg/resource/select.go:54 +0xe7
| 2020-06-07T17:02:19.225+08:00 | github.com/cloudetc/awsweeper/pkg/resource.Filter.Apply(0xc000527590, 0xc000d56b40, 0x3, 0x4, 0xc000d56b40, 0x3, 0x4)
| 2020-06-07T17:02:19.225+08:00 | /home/jan/git/github.com/cloudetc/awsweeper/pkg/resource/select.go:15 +0x10a
| 2020-06-07T17:02:19.225+08:00 | github.com/cloudetc/awsweeper/pkg/resource.List(0xc0000c20b8, 0xc000d60000, 0xc0001bc800, 0xc000600b80, 0x5ab8ee6, 0x6, 0xc000061860, 0x0, 0x0)
| 2020-06-07T17:02:19.225+08:00 | /home/jan/git/github.com/cloudetc/awsweeper/pkg/resource/list.go:56 +0x61f
| 2020-06-07T17:02:19.225+08:00 | main.mainExitCode(0x0)
| 2020-06-07T17:02:19.225+08:00 | /home/jan/git/github.com/cloudetc/awsweeper/main.go:157 +0xd77
| 2020-06-07T17:02:19.225+08:00 | main.main()
| 2020-06-07T17:02:19.225+08:00 | /home/jan/git/github.com/cloudetc/awsweeper/main.go:30 +0x22
| 2020-06-07T17:02:19.229+08:00 | [ERROR] CalledProcessError: Command '['./bin/awsweeper', '--debug', '--region', 'ap-northeast-1', '--dry-run', './config/aws_resource.yml']' returned non-zero exit status 2. Traceback (most recent call last): File "/var/task/src/awsweeper.py", line 17, in lambda_handler output2 = subprocess.check_output(CMD2, universal_newlines=True) File "/var/lang/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/var/lang/lib/python3.8/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args,
| 2020-06-07T17:02:19.237+08:00 | END RequestId: e1dcc93a-b710-4c66-8ac2-edae677987d9
| 2020-06-07T17:02:19.237+08:00 | REPORT RequestId: e1dcc93a-b710-4c66-8ac2-edae677987d9 Duration: 18563.05 ms Billed Duration: 18600 ms Memory Size: 512 MB Max Memory Used: 504 MB Init Duration: 120.13 ms
| 2020-06-07T17:06:03.457+08:00 | START RequestId: 81239d90-efb1-46ed-afa8-453fc442cf75 Version: $LATEST
-
How are you downloading the awsweeper binary into the lambda? From an S3 bucket? An option would be to also pre-download the extra binary that awsweeper needs (https://releases.hashicorp.com/terraform-provider-aws/2.59.0/) and then you wouldn't need the NAT gatway. I would need to fix something first for this "offline" mode, though.
Yes, I build and package awsweeper binary in local, upload to s3 for Lambda use.
Not sure how to proceed the manual setup forterraform-provider-aws
for the offline mode. -
I will investigate myself if it is problem running awsweeper in a lambda in another region. If so, it shouldn't be this way.
Looking forward to another magic, thanks in advance.
from awsweeper.
Is it actually the new version https://github.com/jckuester/awsweeper/releases/tag/v0.9.0 that you are using here?
from awsweeper.
Yes, it should be the newest version. otherwise the new tag feature will not be workable.
from awsweeper.
Thanks @jckuester
I will be busy with a few stuff recently, will let you know if the new version is workable in Lambda.
Happy to know you bring in offline mode soon.
Much appreciate.
from awsweeper.
Just letting you know that the offline mode is coming in PR #116 and is released soon. Hope that will help to get rid of the NAT gateway.
from awsweeper.
Released in v0.10.2.
For offline mode, please copy the Terraform AWS provider binary (https://releases.hashicorp.com/terraform-provider-aws/2.68.0/) to ~/.awsweeper/terraform-provider-aws_v2.68.0_x4
(note: the binary name might differ for the platform that you're using).
from awsweeper.
Related Issues (20)
- Provide functionality deletion by ARN HOT 1
- error: Must specify Username when calling with non-User credentials HOT 3
- Throttling: Rate exceeded HOT 3
- Support for aws_rds_cluster HOT 6
- WAF: ListLoggingConfigurationsRequest (AccessDeniedException) HOT 1
- Error: failed to configure provider (name=aws, version=3.16.0): HOT 1
- aws_db_instance: FAILED TO DELETE THE FOLLOWING RESOURCES (RETRIES EXCEEDED): 1 HOT 1
- Tag exclusion not functioning for aws_workspaces_directory HOT 1
- Running on linux, getting "failed to install provider"
- Docker Image Problems with 0.11.1 HOT 3
- aws_rds_cluster_endpoint - SIGSEGV: segmentation violation HOT 1
- Ignore Terminated EC2 Instances
- Filters tag and created not working together HOT 3
- Version of Terraform has outdated GPG key HOT 6
- About the latest release HOT 1
- Discovery Performance HOT 3
- Security Group Rule Deletion
- AWS EC2 Client VPN Endpoint Unable to List
- Kinesis Firehose can not be deleted
- aws_cur_report_definition doesn't exist
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 awsweeper.