Import mapping
Import associates an existing remote object with a Terraform resource address. The object must have one clear ownership mapping; importing the same object into multiple states creates conflicting management. Provider-specific identifiers and resource import support must be checked in official documentation. For example, an existing bucket ID maps to aws_s3_bucket.logs in one intended state, not two competing environment states.
An existing bucket ID maps to aws_s3_bucket.logs in one intended state, not two competing environment states.
An existing bucket was created outside Terraform. The team selects one intended resource address and uses the provider-supported import identifier to associate that address with the bucket. No second bucket needs to be created. The state mapping now says that this logical resource manages the existing remote identity, but configuration still determines the desired settings.
Import adopts an existing object into management. A resource address identifies its place in configuration. An import identifier is provider-specific and may not match an arbitrary display name. Check support and ownership before execution. Importing the same object into two states makes both managers believe they control it, creating conflicting plans. Secure state backups and a reviewed import plan help adoption, but importing is not a backup of object contents. Agree that any previous automation or manual process stops competing for the same settings, or deliberately document which attributes remain externally managed.
An existing bucket ID maps to aws_s3_bucket.logs in one intended state, not two competing environment states.
Do not overlook this operational distinction: Provider-specific identifiers and resource import support must be checked in official documentation.