Skip to content

Frequently Asked Questions

General

Answer to the Ultimate Question of Life, the Universe, and Everything?

42 (Reference)

What exactly is the CDN doing?

The CDN is distributing the traffic to the corresponding Services/AWS Accounts. Depending on the url configuration, the CDN will route to one of the new 4.0. Remix applications or to the monolith (configfrontend).

Does deploying our app also upload some assets to the CDN?

If you consider route information assets, yes. The deployment scripts are updating the CDN configuration if the application URL (or other related configuration) has changed.

Statics files (e.g. CSS or JavaScript) are not activly uploaded into the CDN.

Are there requests which are handled directly by the CDN?

Well, we could say so. For example some Requests might never reach any origin (e.g. Remix Lambda or the monolith), due to the WAF being in place and shielding us from some of the traffic which is considered crawling, etc. Generally speaking the Remix Lambda should never be called outside of the WAF. If a user accesses the statista.com website it will always route through the CDN which in turn calls one of the origins (e.g. Remix Apps or the monolith).

Applications should anser with a 403 response if called directly without routing through the CDN. This could be detected by the x-lambda-auth header the CDN adds to the request. This header is - though the name suggests it - not tied to the Lambda architecture.

Does the CDN cache some of the assets provided by the Remix Applications?

Depends.

Genereally speaking the CDN does response the reponse cache headers of the origin application.

For Remix applications in addition it does cache static files served by your application (static means all files in the build/client folder of the Remix build) These files are all named with a hash of the content of the file and are stored in the CDN for 1 year+.

How to create a webhook for Microsoft Teams?

Note: The "Incoming Webhook" app for Microsoft Teams is being deprecated and will no longer be available after the end of 2025. Avoid using this app for new implementations.

To create a webhook for posting messages to a Microsoft Teams channel, you can use Power Automate. Follow these steps:

  1. Select the Channel: Right-click on the Teams channel where you want to post messages via a webhook and choose Workflows from the context menu.
  2. Choose a Workflow: In the modal that appears, browse or search the workflow suggestions and select Send webhook alerts to a channel.
  3. Name Your Workflow: On the next screen, provide a name for your workflow to identify it easily.
  4. Get the Webhook URL: Complete the setup, and you will receive a unique URL. Use this URL to send POST requests to deliver messages to the selected Teams channel.

That's it! You now have a webhook ready to send messages to your Teams channel using Power Automate.

In Power Automate you will see the workflow now.

Frontend / node.js

How to handle npm packages @statista?

There are two things to know about npm packages:

  • How to use our internal packages
  • How to publish a package internally

How to use our internal packages

Create a GitHub personal access token with package:read scope.

Then use the commands below to setup the token. Choose the command with your preferred package manager.

# one of these
pnpm config set //npm.pkg.github.com/:\_authToken=<github token with packages scope>

In your project local .npmrc add these lines:

registry=https://npm.pkg.github.com/<your github org name>/
@cpe-orga:registry=https://npm.pkg.github.com/
@pit-marketing-content:registry=https://npm.pkg.github.com/
@pit-martech:registry=https://npm.pkg.github.com/
@pit-mlc:registry=https://npm.pkg.github.com/
@pit-shared:registry=https://npm.pkg.github.com/
@pit-tracking-analytics:registry=https://npm.pkg.github.com/
@statista:registry=https://npm.pkg.github.com/

Add other orgs if required.

Afterwards a package installation should work:

pnpm install

How to publish a package internally

Create a GitHub personal access token with package:write scope.

Setup the token as described in the chapter above.

Add a publishConfig key into your package.json and setup the repository you want to publish to:

{
  "publishConfig": {
    "repository": "https://npm.pkg.github.com/<your github org name>/"
  }
}

Then you can use any tool to publish packages (e.g. changesets).

GitHub Actions

The workflows fail at the step actions/setup-node with error 403

Description

The error message says

  ERROR  GET https://npm.pkg.github.com/pit-shared/pnpm: Forbidden - 403
  No authorization header was set for the request.

Answer

Replace actions/setup-node and any code that sets up pnpm with pit-shared/actions/setup-pnpm@main

Original

   - name: Install pnpm
      run: npm install -g pnpm
   - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
     with:
        node-version: 18
        cache: pnpm

    - name: Setup npm authentication
      run: pnpm config set //npm.pkg.github.com/:\_authToken=${{ github.token }}
    - run: pnpm install

Updated

- uses: pit-shared/actions/setup-pnpm@main

AWS

How to troubleshoot resource config issues

When working with AWS resources, configuration issues are common. Here are the main approaches to diagnose and resolve them:

General issues

Use Amazon Q within your account! Amazon Q has access to most of your resource configurations and is quite good at finding misconfigurations and will often point you into the right direction.

How to access Amazon Q:

  1. Sign in to the AWS Management Console
  2. Look for the Amazon Q icon in the top-right corner of any AWS console page
  3. Click on the icon to open the chat interface
  4. Alternatively, you can search for "Amazon Q" in the AWS services search bar at the top of the console

Example: "Why can my Lambda function xyz (ideally, specify the ARN) not reach the internet?"

Amazon Q will analyze the routing tables, VPC configuration and security groups and come up with possible solutions for you.

Networking

If you already know that you have a networking issue or you want to understand which route traffic is taking from a given source to a defined destination, you can use the VPC Reachability Analyzer.

Important limitation: The analyzer does not work cross-account. If you need cross-account analysis, reach out to the CDX team to set this up for you or task them to help with a central analysis from within the root account.

How to use VPC Reachability Analyzer:

  1. Navigate to the VPC console in the AWS Management Console
  2. Select "Reachability Analyzer" from the left sidebar or search
  3. Create a new path analysis by specifying source and destination
  4. Review the analysis results to identify potential connectivity issues