Git Product home page Git Product logo

Comments (8)

jckuester avatar jckuester commented on June 2, 2024 1

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.

jckuester avatar jckuester commented on June 2, 2024

Hi @showerlee,

  1. the nil pointer panic (panic: can't use ElementIterator on null value) is definitely a bug, which I need to fix.

  2. can you run awsweeper with -debug flag, so that we can see more infos?

  3. 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.

  4. 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.

showerlee avatar showerlee commented on June 2, 2024

Hi @jckuester ,

  1. 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.

  2. 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
  1. 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 for terraform-provider-aws for the offline mode.

  2. 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.

jckuester avatar jckuester commented on June 2, 2024

Is it actually the new version https://github.com/jckuester/awsweeper/releases/tag/v0.9.0 that you are using here?

from awsweeper.

showerlee avatar showerlee commented on June 2, 2024

Yes, it should be the newest version. otherwise the new tag feature will not be workable.

from awsweeper.

showerlee avatar showerlee commented on June 2, 2024

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.

jckuester avatar jckuester commented on June 2, 2024

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.

jckuester avatar jckuester commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.