Prepare resources needed for login processing

Prepare resources for issuing anonymous accounts and logging in

To start using the GS2-Account service, you need to add a namespace.

Namespace (namespace) is a mechanism to allow the same service to be used for different purposes within a single project. Within different namespaces, the same service is treated as a completely different data space.

Now, using the sample template, add game-0001 to the GS2-Account namespace name and issue the encryption key that will be used to authenticate the account and make it possible to create a new account.

Create resources with GS2-Deploy

GS2-Deploy is a service for collectively creating and managing resources for multiple services based on template files (YAML format).

  1. Log in to the Management Console.
  2. Select Deploy from the left menu and click Stacks.
  3. Click Create new stack.
  4. Enter an arbitrary name such as initialize-account in Stack name.
  5. Copy and paste the following template content into the Template data field.
  6. Click the Create button.

It will take a few seconds to several tens of seconds to complete. It is complete when the status becomes CREATE_COMPLETE.

GS2TemplateFormatVersion: "2019-05-01"
Description: GS2-Account initialize template Version 2010-06-26

Globals:
  Alias:
    AccountNamespaceName: game-0001
    KeyNamespaceAccountAuthentication: account-encryption-key-namespace
    KeyAccountAuthentication: account-encryption-key

Resources:
  KeyNamespaceAccountAuthentication:
    Type: GS2::Key::Namespace
    Properties:
      Name: ${KeyNamespaceAccountAuthentication}

  KeyAccountAuthentication:
    Type: GS2::Key::Key
    Properties:
      NamespaceName: ${KeyNamespaceAccountAuthentication}
      Name: ${KeyAccountAuthentication}
    DependsOn:
      - KeyNamespaceAccountAuthentication

  AccountNamespace:
    Type: GS2::Account::Namespace
    Properties:
      Name: ${AccountNamespaceName}

Outputs:
  AccountNamespaceName: !GetAttr AccountNamespace.Item.Name
  KeyAccountAuthenticationKeyId: !GetAttr KeyAccountAuthentication.Item.KeyId

Download sample template