https://pulumi.com logo
#aws
Title
# aws
b

bland-painting-33593

01/25/2024, 1:17 AM
I'll be honest, the mix of aws, awsx, and aws-native, none of which seem to fully support all modern AWS functions, is infuriating. And the AI talks in circles. awsx supports ECS Fargate better, but awx sucks at making a proper, working load balancer/target group with https listeners. The documentation on awsx is missing a lot of details, which would be fine if the AI could fill them in, but then it starts going back to aws. Some expose arns, some don't. Is there like a github repository or something with fully fleshed out examples of entire stacks top to bottom? Sanitized, of course.
What a way to say "I imagined this function completely" "The Pulumi AWSX library has abstracted away some elements of the creation of target groups in its higher-level constructs, which can lead to confusion if the expected functions or methods like
createTargetGroup
are not present. However, you can still create a target group directly using the AWS package. Below is an updated version of the program that uses
aws.lb.TargetGroup
resource from the
@pulumi/aws
package to create the target group, instead of using a non-existent method."
Honestly, even searching from Google for examples just returns AI results which are daydreamed and don't work when copied and pasted directly in as-is.
b

billowy-army-68599

01/25/2024, 3:48 AM
Candid answers: • Don’t use awsx - it’s really not fit for purpose • there’s no real examples of fleshed out stacks of big infrastructure projects OSS. There are examples that exist: https://github.com/jaxxstorm/pulumi-examples - happy to chat if you need assistance • AI/GPT 4 in general has an issue with hallucinations, it’s not going to give you the answers you need.
b

bland-painting-33593

01/25/2024, 2:29 PM
I really appreciate the candid answers and the examples! I was only using awsx because the pulumi new container option used it. Maybe the awsx and aws-native stuff should be labeled as beta or something to be more clear. A lot of the examples out there are encouraging them. I'll clean sheet and start building only with aws off of your examples, and we'll see how far this old physical sysadmin who hates code gets today. 😉
...your ecs example uses awsx in several places?
b

bland-painting-33593

01/25/2024, 2:39 PM
yep. For the VPC and the Cluster
and the service
b

billowy-army-68599

01/25/2024, 2:39 PM
the VPC and cluster are relatively well defined, the ECS service part is not
b

bland-painting-33593

01/25/2024, 2:40 PM
This is the service in the example
b

billowy-army-68599

01/25/2024, 2:40 PM
it’s also 3 years old, sadly
b

bland-painting-33593

01/25/2024, 2:40 PM
gotcha
b

billowy-army-68599

01/25/2024, 2:42 PM
some up to date code in python here: https://github.com/lbrlabs/brig.gs/tree/main
b

bland-painting-33593

01/25/2024, 2:44 PM
Yeah, I'm not a developer, and I'm doing my best with TS, so that likely won't help me 😉 But thank you for all of your assistance!
s

salmon-account-74572

01/25/2024, 4:44 PM
We recently did a reference architecture with Pinecone in TypeScript, and that used ECS. Perhaps some of that code would be helpful? (Note: there is a fair amount of AWSX in there.) Here’s the URL: https://github.com/pinecone-io/aws-reference-architecture-pulumi/
b

bland-painting-33593

01/25/2024, 5:31 PM
With a fresh start in the morning, I did finally get it all launched this morning, completely with aws only! I might set up a public github and put sanitized versions out there so there are more examples available. Thanks, everyone!
s

salmon-account-74572

01/25/2024, 8:50 PM
Let us know if you do decide to publish something, I’d love to help get the word out about it!
b

bland-painting-33593

01/25/2024, 8:56 PM
Will do!
g

gifted-gigabyte-53859

01/29/2024, 9:37 AM
I've had similar problems re: being confused about aws classic, aws native, aws crosswalk (awsx) and aws crosswalk (no awsx label, just has a different name. Here's a comment I ended up putting in my code after hours trying to work out what was going on
Copy code
# <https://www.pulumi.com/registry/packages/aws-apigateway/api-docs/restapi/> <- aws 'crosswalk' provider, used to simplify creation of the apigateway
# <https://www.pulumi.com/registry/packages/aws/api-docs/apigateway/restapi/> <- aws crosswalk creates this as the underlying object (i.e. ${api_app.api})
Even now, after 2 years using this stuff, I'm still not entirely sure I understand what's going on. I suspect that the api-gateway plugin I use may not be full crosswalk? Or something? That said, I love awsx and hope you guys continue developing it. It makes it so incredibly simple and easy to deploy API gateway for example. And ECS. As an example, this is our entire frontend code:
Copy code
##
  # Frontend/App
  # Serve the frontend from an S3 bucket, while keeping the bucket private.
  api_app:
    type: aws-apigateway:RestAPI
    properties:
      stageName: ${pulumi.stack}
      routes:
        # <https://www.pulumi.com/registry/packages/aws-apigateway/api-docs/restapi/#target>
        - localPath: ${confFrontendCompiledFilesPath}
          method: GET
          path: /
Amazing.
b

bland-painting-33593

01/30/2024, 7:22 PM
@salmon-account-74572 Here you go. Only one example for now, but I will endeavor to add all the things I build, and maybe organize it better as I go. 😉 https://github.com/darkmagedtm/pulumi_aws_examples/tree/main
I also added an example of importing a Lambda just now