storacha-network / w3infra

๐Ÿ—๏ธ Infra for the w3up UCAN protocol implementation
Other
13 stars 5 forks source link

fix: ipni service configuration for non west 2 deployments #370

Closed vasco-santos closed 2 months ago

vasco-santos commented 2 months ago

Yesterday I was puzzled on why my local deployment of Integration tests was working, while CI was not with some random errors just in few tests (with similar error as previous lack of permissions). It turns out, it was more lack of permissions, together with some bad configuration.

This extra permissions and configuration are actually a consequence of a different deployment approach per environment on w3up infra compared to old E-IPFS infra. Let's see the details:

w3up infra deployments:

E-IPFS infra deployments:

Considering the above, when we would be in prod or dev, both infras would be deployed in same zone. However, for staging and PR deployments, there would be a gap. Two problems needed to be addressed to make this work:

  1. Actually the content of this PR, we were assuming E-IPFS infra was in AWS_REGION ENV VAR, which is the region current code is deployed at. I changed this to infer the region based on the provided ARN for these resources.
  2. SQS is more tricky than DynamoDB, and does not support out of the box to communicate between zones, unless it is explicitly allowed in the policies. I manually set a policy in the SQS staging queue to allow this to happen https://us-west-2.console.aws.amazon.com/sqs/v3/home?region=us-west-2#/queues/https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F505595374361%2Fstaging-ep-multihashes-topic . Note that it guarantees that only lambdas running on this account can send messages through the queue. We should add this to the actual old infra setup, but I have no idea at this point on how to do it, and was hoping that @joaosa could help out on this one ๐Ÿ™๐Ÿผ
seed-deploy[bot] commented 2 months ago
View stack outputs - **pr370-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr370-w3infra-customer spaceDiffTableName | pr370-w3infra-space-diff spaceSnapshotTableName | pr370-w3infra-space-snapshot usageTable | pr370-w3infra-usage - **pr370-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://9rc1hygkck.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://akj53r5ux2khj3jm7vhfvqrxyy0btohc.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr370.billing.web3.storage - **pr370-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr370-0 Region | us-east-2 - **pr370-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://axragff13l.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr370.roundabout.web3.storage - **pr370-w3infra-SatnavStack** Name | Value -- | -- BucketName | satnav-pr370-0 Region | us-east-2 - **pr370-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoint | https://j64nw1gp42.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr370.up.web3.storage - **pr370-w3infra-BusStack** - **pr370-w3infra-FilecoinStack** - **pr370-w3infra-ReplicatorStack** - **pr370-w3infra-UcanFirehoseStack** - **pr370-w3infra-UcanInvocationStack** - **pr370-w3infra-UploadDbStack**