Naming Resources

Editor’s Note: The resources of Fugue are a work in progress and can be expected to change as we refine and expand our AWS service coverage. For any questions about resources not identified here or resources in general feel free to reach out to us through support@fugue.co.

How does Fugue handle naming resources in AWS? The answer varies, but there is a rule. Fugue derives resource names for you based on your composition when possible. However, if your application is likely to interact with a resource directly, you must specify a name.

Resources Which Fugue Names

If a resource is something that you should only modify through Fugue, its name is a generated GUID, which guarantees that the resource is uniquely named. This makes the resource easier for the Conductor to track precisely. In these cases, the binding name in Ludwig usually appears as a Name tag.

Examples:

  • AutoScaling Groups (ASGs)
  • Security Groups (SGs)

Resources Which You Name

If a resource is one that you are likely to interact with in application code, a name for it is required in its Standard Library type. For example, this can take the form of a field like name or loadBalancerName. In these cases, Fugue uses the name value provided in the Ludwig (NOT the Ludwig binding name) as the resource name. These resources are typically required to have names that are unique - in other words you can’t have two DynamoDB tables with the same name.

Examples:

  • DynamoDB table (tableName field)
  • S3 bucket (name field)

Idempotent Create Calls of Named Resources

To create a resource declared in Ludwig, Fugue sends a “create” call to the AWS API. For certain named resources, these create calls are idempotent, meaning a second call to create a resource with the same name has no effect but gives the same success message. Fugue addresses this ambiguity by raising an error (ResourceAlreadyExists) when handling a second request to create the same resource. For example, if you declare an S3 bucket in a composition, then run the composition twice, one run will succeed and the other will fail with an error message. This enables you to resolve the issue with Ludwig.

This affects the following AWS API calls:

  • Create S3 bucket
  • Create SQS queue
  • Create/update CloudWatch alarm

Warning

In very rare cases of idempotent create calls, Fugue may not throw an error message on the subsequent call and will instead associate the already-created resource with the new process. For example, if you create an S3 bucket in the AWS Management Console and immediately run a composition referencing an S3 bucket with the same name, there is a chance that Fugue could associate the externally-created S3 bucket with the process, rather than throwing an error that the bucket already exists. This problem can be avoided by waiting a minute or two between creating the bucket in the console and running a process that would create the same bucket name.

Deleting Named Resources

Similar to how enforcement works to counter deletion, if you delete a named resource outside of Fugue, it’ll take at least 10 minutes before Fugue can recreate the resource with the same name. Fugue relies upon API describe calls to AWS to get an accurate picture of your infrastructure, and AWS’s API is eventually consistent, meaning it can take time for changes to be distributed. Fugue caches the results of these describe calls for at least 10 minutes to hedge against performance and reliability issues in AWS. Therefore, it takes at least 10 minutes for Fugue to consider a resource to be deleted and recreate it. The time may be longer depending on the performance of Fugue and AWS.

This affects the following AWS API calls:

  • Create S3 bucket
  • Create SQS queue
  • Create/update CloudWatch alarm

Most Other AWS Resources

The most common category of resources within AWS are those resources that don’t have specific names. These resources are identified using Amazon-generated names. When tags are available, we store name information within the tags.

Items to note

  • While Ludwig binding names are associated with resource metadata whenever possible (usually via tags), Fugue never uses the Ludwig binding name directly as the resource name. The resource name is always a generated GUID, or a user-provided name when a name or similar field is in a resource’s Standard Library type.